简体   繁体   中英

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

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.

在此输入图像描述

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM