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

2019-08-06 05:42发布

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.

enter image description here

2条回答
神经病院院长
2楼-- · 2019-08-06 06:09

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.

查看更多
疯言疯语
3楼-- · 2019-08-06 06:24

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.

查看更多
登录 后发表回答