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
2009-10-14 00:36:39
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
2009-10-14 01:22:52
I think by "roll", he meant "Roll" - as in, totally custom...
Kendall Helmstetter Gelner
2009-10-14 01:31:57
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
2009-10-14 01:53:34
Double drats. I guess I'm in for the long haul.
alexbw
2009-10-14 09:38:23
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
2009-10-14 13:39:30
Can anyone point to any good resources on how to do this? How can I create my own UITabBar?
barfoon
2010-10-26 01:22:14
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
2009-11-06 14:57:03
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
2009-11-20 15:58:42
A:
You can achieve a similar effect by placing a segmented control inside a uitoolbar. I did this and it looks quite nice.
Jonah
2010-02-17 15:58:35