开发者

Changing the tab bar title of the moreNavigationController from "More" to a custom

开发者 https://www.devze.com 2023-01-20 02:58 出处:网络
is there a way to change the title in the tabbar of the moreNavigationController? I开发者_运维百科t always shows \"More\". I tried it with setting the moreNavigationController.tabBarItem.title, unfort

is there a way to change the title in the tabbar of the moreNavigationController? I开发者_运维百科t always shows "More". I tried it with setting the moreNavigationController.tabBarItem.title, unfortunately it seems to have to effect.

Sincerely, Heinrich


Sure there is:

Just do this:

self.tabBarController.moreNavigationController.navigationBar.topItem.title = @"Custom Title";


To change More controller's title, you have to set title property by directly accessing its first view controller in the navigation stack:

self.tabBarController.moreNavigationController.viewControllers[0].title = @"Custom Title";

I would not recommend changing navigation bar's topItem title directly, because this title will change when user navigates back and forth, and iOS will take title from corresponding controller's title property.

0

精彩评论

暂无评论...
验证码 换一张
取 消