How to change UITabBarController More button's title?

老子叫甜甜 提交于 2019-11-29 20:26:35

问题


I have a Tab Bar app. The app has 8 UITabBarItems and the More button is added automatically. I want to change the title from More to something else.

I have already tried the following:

tabbarController.moreNavigationController.tabBarItem.title=@"Test";

But it still displays "More". No error. No changes.

How can I change the "More" text to another?


回答1:


The label under the "More" button is localized for you based on the user's current Locale as specified in their Settings. However, you have to declare your support for that locale in your app's Info.plist.

Add the CFBundleLocalizations key to your application's Info.plist and set its value to an array whose values are the locales for which you want the app to automatically localize system labels. For example, if you want to localize for both English and Japanese, you would add the following entry to the Info.plist:

<key>CFBundleLocalizations</key>
<array>
    <string>en</string>
    <string>ja</string>
</array>



回答2:


I had the same problem - just go to your Info.plist file, and change the "Localization native development region" key to your language. The "more" button title changes automatically. This also auto-changes some other system button titles (eg the "edit" button in the icon order customization toolbar)




回答3:


From the documentation:

"The title and image of system tab bar items cannot be changed."




回答4:


Try this:

tabBarController.moreNavigationController.navigationBar.topItem.title = @"new title";

works for me



来源:https://stackoverflow.com/questions/3918515/how-to-change-uitabbarcontroller-more-buttons-title

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!