views:

1493

answers:

3

I would like to be able to thin the UITabBar's height by removing each item's titles and reclaiming the vertical space they take up, a la Tweetie 2. This doesn't seem settable in the .xib or programmatically. Will I have to subclass the UITabBar and roll my own?

+3  A: 

Roll your own. I'm sure Tweetie 2's is custom; and the height is set in the handed down UITabBar.

JoePasq
I'm a bit lost as to where to begin subclassing this... the UITabBar's height property, and most likely its setItem:animated: method as well. Any other tips/resources for subclassing UIView objects like this?
alexbw
I think by "roll", he meant "Roll" - as in, totally custom...
Kendall Helmstetter Gelner
Kendall is right in my use of roll, sorry for the confusion and let down.I agree though, it would sure be nice to have a customizable tab bar controller.
JoePasq
Double drats. I guess I'm in for the long haul.
alexbw
I suggest carefully studying the view controller's behavior in relation to other views and then piggybacking off of that, but modifying it where needed. For example, Tweetie 2 uses it's own icons, so it doesn't need to copy the special glare effect on the tab bar items (read the docs if you don't know what I mean); and your app may not need more than five tabs, so you can eliminate that functionality. But you may need to do some more work to support landscape mode. (If that helps at all.)
JoePasq
Can anyone point to any good resources on how to do this? How can I create my own UITabBar?
barfoon
A: 

Did you have any luck with this?

I am currently implementing a custom tabbar by creating my own, using a toolbar. This is quite annoying as all of the functionality is in tabBarController, but it really isn't friendly towards subclassing or modifying the UITabBar member.

I plan on posting this code once it is available.

MM
I went off and worked on other things for awhile, but am now coming back to it. If you've got the code, stick it up on github or something.I'm working on an OpenGLES-based iPhone app, and my main goal is to have tabBarItems that fire selectors, not start up view controllers (although you could easily wire them to do so).
alexbw
A: 

You can achieve a similar effect by placing a segmented control inside a uitoolbar. I did this and it looks quite nice.

Jonah