IOS study notes (3) view UITabbarController

1.UITabbarViewController label trying controller. Because content between views on this tab plays the role of classification, so often presented, it may be irrelevant functions.

UITabbarViewController still inherited from UIViewController, but the label and navigation bars have always been in the forefront of the characteristics of all views.

For tab bar, he is the object of a UITabbar class, both horizontal and vertical screen, which can be placed on top of a minimum of 1 and a maximum of 5 tabs. Of course, if there are more tabs, then the last page of the tab bar will change to a default "More" title with the default "..." label project the image.

And, UITabbarController also supports editing sorting, editing controllers support all attempts on customizableViewControllers property configuration as long as the developer for the UITabbarController, the navigation view at the top right of the subsequent "" More "label items displayed, the user can click" Edit "on the edit mode, you want to customize the project page on the tab bar, and the order between each display.

2. The markings on the tab

When trying controller and a tab related to each other, the developer can be accessed via the property tabBarItem view controller object to the label project for the mark, it only needs a string of content on badgeValue Fu tabBarItem can,

self.navigationController.tabBarItem.badgeValue=badgeTxtF.text

3. warning box on the tab bar

Because UITabbarController of UITabbar target for the entire view hierarchy, it is always at the front in a state of most top-level status. Methods So when developers need to be UIActionSheet present a warning box, no longer applies to the showInView, showFromTabBar method when UIActionSheet object instead

1 UIActionSheet Sheet * = [[UIActionSheet alloc] initWithTitle: @ " test alert box "  delegate : nil cancelButtonTitle: @ " Cancel "   destructiveButtonTitle: "@ important button "   otherButtonTitles: nil];
 2  
3 [Sheet showFromTabBar: self.tabBarController.tabBar ];

4. Hide the tab bar

  Like us on a navigation bar and status bar is hidden as the tab bar and in some cases also supported hidden.

  The reason here to say that "under certain circumstances", because the default tab bar can not be hidden, even if we force the hidden object became property of the UITabbar YES, the entire interface will be left in the position of a blank tab bar, any attempt controllers can not be really covered.

  However, the item tag is a corresponding view controller navigation view controller, when the display of the navigation view controller push a new view, developers can make the new view from the new view hidesBottomBarWhenPushed controller is displayed at untagged under the status bar. Since the new view will fill the position where the tab bar caused by their highly stretched, all views above the controls needed to maintain the correct position.

1 testVC.hidesBottomBarWhenPushed=YES;

 

Reproduced in: https: //www.cnblogs.com/haibosoft/p/3660610.html

Guess you like

Origin blog.csdn.net/weixin_34090562/article/details/94193085