How do I resize the tab bar items in Xcode 4.3.1?

一世执手 提交于 2019-12-11 07:25:53

问题


I've been searching on how to resize the tab bar items on the "Tab Bar Controller," but obviously couldn't find anything.

The reason why I want to do this is because I have exactly 6 items, and it causes the "more" item to be created whenever you have 6 or more. So 4 items show up on the bottom and a "more" item that shows the other two items when clicked.

My title for all my items are short, so I want to squeeze 6 of them right below without the "more" and the only way to do that is to shrink the items width. How can I resize the width of each item?

An Image is attached if I wasn't clear enough, thanks in advance.


回答1:


The UITabBarController does not support much customizing, so you'll either need to write your own or use one that has already been written by someone else for a similar purpose. You should check cocoacontrols.com and github, I'm sure something already exists to accomplish this, or at least something you can easily modify.




回答2:


Even if you were able to subclass a TabBar and change it's behavior, you'll likely have to override it's internal methods and it's hard to estimate the required time.

To meet your requirements, i would hide the tab bar and display another control instead (probably a segmented control) passing it's selection events to the used tabBarController. That's an easy and fast way, and your app will not be rejected.



来源:https://stackoverflow.com/questions/10762036/how-do-i-resize-the-tab-bar-items-in-xcode-4-3-1

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