0

我的应用程序中有一个 UITabBar,其中包含三个选项卡栏项。

在某些情况下,我想显示所有三个标签栏项目,而在某些情况下,我想从标签栏中隐藏第三个标签栏项目。

请帮我

4

1 回答 1

3

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];
于 2009-11-04T07:27:48.813 回答