Iphone 将标题更改为“;“更多”;标签

Iphone 将标题更改为“;“更多”;标签,iphone,uitabbaritem,tabbarcontroller,Iphone,Uitabbaritem,Tabbarcontroller,有没有办法更改“更多”选项卡上的标题(uitabaritem上的文本)?摘自此 是的,这是可能的 UINavigationBar *moreNavigationBar = tabBarController.moreNavigationController.navigationBar; moreNavigationBar.topItem.title = @"Your title"; tabBarController是您的UITabBarController。如果您想更改“更多”选项卡导航栏的标题

有没有办法更改“更多”选项卡上的标题(uitabaritem上的文本)?

摘自此

是的,这是可能的

UINavigationBar *moreNavigationBar = tabBarController.moreNavigationController.navigationBar;
moreNavigationBar.topItem.title = @"Your title";

tabBarController是您的UITabBarController。如果您想更改“更多”选项卡导航栏的标题,请使用7KV7给出的方法

如果您想更改选项卡标题

还有另一种方法

假设你有八个标签

1) 在选项卡栏控制器中…仅创建五个选项卡…删除除五个选项卡以外的所有其他视图

2) 让我们将第五个选项卡作为“更多选项卡”…将其作为tableviewController,并在其tableView元素中添加元素作为第六个..第七个..第八个选项卡的名称和图像

3) 在fifthViewController的rowdidselect方法中,导航第六、第七和第八选项卡各自的视图控制器

优点:-您可以更改“更多”选项卡的名称和图像
缺点:-您不能使用“更多”选项卡的“编辑”按钮来更改选项卡元素的顺序


如果您对此感到满意,请尝试使用它。

在UITabBarController中,您只需在viewDidLoad和superViewDidLoad下添加以下简单行:

 self.moreNavigationController.navigationBar.topItem.title = @"Your Title";
那么它应该是这样的:

 - (void)viewDidLoad {
     [super viewDidLoad];   // Do any additional setup after loading the view.

     self.moreNavigationController.navigationBar.topItem.title = @"Mer"; 
     }

为了让它工作起来,我还创建了一个新的Objective-c类,命名为:“MyTabBarController”。然后我在故事板中单击了我的TabBarController,并将类设置为:“MyTabBarController”。当我将代码粘贴到.m文件中时,它工作得非常好。

感谢您的想法,但它不适合于me@termit...what你想做什么??是否仅更改“更多”导航栏的名称,还是更改“更多”选项卡的标题??因为我在一个项目中也使用了7KV7给出的方法…对我来说效果很好:)我想更改更多tabwell的标题,然后你也可以在tabBar上添加标签..将背景设置为黑色…并将字体设置为其他字体。。。然后把它放在上面写着更多的东西。这是可能的:)…如果你觉得舒服,试试看