UITabBar + UINavigationBar 标题冲突
我在 IB 中创建了一个 UITabBar 和一个 UINavigationBar,当我每次导航 UINavigation 标题更改时启动应用程序时,因为我使用的
self.title = @"NAME";
问题是 UITabBarItem 将同时以相同的名称更改。 我只想为 UITabBarItem 添加一个静态名称,如何在 IB 中或以编程方式执行此操作。
谢谢,
I have a UITabBar and a UINavigationBar created in IB, when I launch my application everytime I navigate the UINavigation title change because I'm using
self.title = @"NAME";
my problem is that the UITabBarItem will change with the same name at the same time.
I want to put a static name only for the UITabBarItem, how to do it in IB or programatically maybe.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试为您的控制器返回一个显式的 tabBarItem,并自己设置其标题。
try returning an explicit tabBarItem for your controller, and set its title yourself.
我在这个地址中找到了解决方案 Stackoverflow navigationItem Title 抱歉,我之前没有找到它发布我的问题。
I find the solution in this adress Stackoverflow navigationItem Title Sorry I didn't find it before posting my question.
试试这个,在你的 viewDidLoad 中
try this, in your viewDidLoad