iPhone + UITabBar
I have a UITabBar in my application with t开发者_运维百科hree tab bar items.
At certain cases I want to show all three tab bar items and some cases I want to hide the 3rd tab bar item from the Tabbar.
Please help me
Send the setItems:animated: message to the UITabBar. For example:
// get array of current UITabBarItem objects
NSMutableArray *tabBarItems = [tabBarViewController.items mutableCopy];
// modify the array (remove or add UITarBarItem objects as appropriate) here
// animate the changes to the UITabBar
[tabBarViewController.tabBar setItems:tabBarItems animiated:YES];
精彩评论