我的应用程序中有一个 UITabBar,其中包含三个选项卡栏项。
在某些情况下,我想显示所有三个标签栏项目,而在某些情况下,我想从标签栏中隐藏第三个标签栏项目。
请帮我
将setItems:animated:消息发送到 UITabBar。例如:
// 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];