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?

alexbw
  • 2,028
  • 2
  • 21
  • 25
  • 1
    Peter Boctor posted a good solution to this issue (and included a few more tab bar UI niceties) [here](https://github.com/boctor/idev-recipes/tree/master/CustomTabBar). – sumizome Nov 24 '12 at 07:30

2 Answers2

4

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

fearmint
  • 5,276
  • 2
  • 33
  • 45
  • 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 Oct 14 '09 at 01:22
  • 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. – fearmint Oct 14 '09 at 01:53
  • Double drats. I guess I'm in for the long haul. – alexbw Oct 14 '09 at 09:38
  • 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.) – fearmint Oct 14 '09 at 13:39
  • Can anyone point to any good resources on how to do this? How can I create my own UITabBar? – barfoon Oct 26 '10 at 01:22
1

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

Jonah
  • 4,810
  • 14
  • 63
  • 76