Tag View Controller-comprehensive use of UITabBarController custom UITabBarItem custom navigation bar and tag Bar background image
I. The tag View Controller UITabBarControllerUITabBarController has the following important attributes: View Controller tabBar label bar delegate protocol displayed by viewControllers
TabBar is a UITabBar object that contains multiple uitabbaritems. Each tanBarItem corresponds to a viewController. The height of tabBar is 49.
When there are more than five tabbaritems, the system will automatically add more buttons and click more buttons. The buttons that do not appear at the bottom will be displayed in a list.
UIAppearance if you want to set the color of all navigation view controllers with one click, similar to the one-click skin Replacement Operation of QQ, you can perform operations through the UIAppearance Protocol, through which you can customize the color of some controls, etc.
UITabBarController * tab = [[UITabBarController alloc] init]; tab. delegate = self; [tab rules: NO]; NSArray * arr = [NSArray arrayWithObjects: nav, nav2, nav3, nav4, nav5, nav6, nil]; [tab setViewControllers: arr]; // the color of the entire line [tab. tabBar setBarTintColor: [UIColor whiteColor]; // The color of each icon [tab. tabBar setTintColor: [UIColor orangeColor];
Summary UITabBarController is a common layout style in project development. Unlike UINavigationController, its viewController is parallel, while UINavigationController is hierarchical.
UITabBatController, UINavigationController, and UITableViewController are usually combined. This layout method is particularly common and must be used skillfully.
UITabBarController can be nested with UINavigationController
UINavigationController can also be nested with UITabBatController
IOS Block usage in IOS, the definition uses "^" to indicate the block variable, the content is included in "{}", and, like the C language, uses "; "to indicate the end of the statement
Int multiplier = 7;
Int (^ myBlock) (int) = ^ (int num) {return num * multiplier ;};
"^" Declares that this is a block, and "myBlock" indicates the variable name.
The Parameter Name of the block return value type int Is "num"
Block note: the variables created by the block are divided into two memory areas: the Global zone and the stack zone. Therefore, if the block member variables or attributes are used in IOS, copy it to the heap memory.