iPhone + UITabBar

Posted

技术标签:

【中文标题】iPhone + UITabBar【英文标题】: 【发布时间】:2009-11-04 07:11:52 【问题描述】:

我的应用程序中有一个带有三个标签栏项目的 UITabBar。

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

请帮帮我

【问题讨论】:

【参考方案1】:

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

【讨论】:

如果创建一个 NSArray,我该如何修改它(添加/删除对象),因为它不可变。

以上是关于iPhone + UITabBar的主要内容,如果未能解决你的问题,请参考以下文章

Swift5 踩过的坑和奇怪的API笔记

iPhone 各大机型设备号

苹果手机型号对应表

在 iphone 5 和 iphone 6 中动态设置字体大小

Surface Pro4链接不上iphone手机的热点

iphone13和12外观的区别 iphone13和iphone12对比哪个好