我在 UIViewController 中为我的一个选项卡执行此操作:
self.title = @"Welcome";
但是,它会覆盖我为 tabBarItem 拥有的所有内容。我努力了:
self.tabBarItem.title = @"Home";
and
[self.tabBarItem initWithTitle:@"Home" image:[UIImage imageNamed:@"iconHome.png"] tag:0];
但是, self.title 仍然会覆盖 tabBarItem,无论我是否尝试后两段代码after标题已定。代码甚至运行没有错误,但是self.tabBarItem.title
or initWithTitle
没有做任何事情?
好吧,我明白了!这就是我正在做的事情:
self.title = @"Title for TabBarItem"; // TabBarItem.title inherits the viewController's self.title
self.navigationItem.title = @"Title for NavigationBar";
the navigationBar
将继承 self.title,除非使用其他设置self.navigationItem.title
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)