开发者

iPhone + UITabBar

开发者 https://www.devze.com 2022-12-10 08:59 出处:网络
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

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消