简体   繁体   中英

Is it possible to hide certain tabs from a UITabBarController?

I am wanting to implement a UITabBarController environment (several view controller chains managed by their own UINavigationControllers ), but don't want all the tabs to be visible in the TabBar (I only want 3 of the 10 tabs visible). The "Home" screen will have buttons that I will use to switch to that specific "tab". Is this possible? If not, can someone suggest an alternative method for accomplishing this behavior?

I have looked through the UITabBarController class reference and saw nothing to indicate a method like " willDisplayTab " or something similar.

UITabBarController *controller = [[UITabBarController alloc] init];

controller.viewControllers = [NSArray arraywithObjects:v1,v2,v3,nil];

this will return you the array of viewcontorllers (tabs).When you want to remove or add additional new tabs you could change the array of viewContrllers.

Yoo can for example keep all viewcontrollers in an array and the visible ones in another.

But the question is when will you update the visible tabs?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM