R – UItabBarItem highlight state image

iphoneuitabbaruitabbaritem

I'd like to be able to change the highlighted state image on an UITabBarItem when it is selected? Is it possible to subclass and access this? or do I need to roll my own navigation code?

-> start edit
I didn't articulate what I was looking for earlier. I am looking for the semi-transparent white overlay reference that the device adds to the selected state/image of the UITabBar. See image! http://solomon71.com/images/UITabBarItem.png

Best Answer

There is no documented or supported way to set your own highlighted image. Having said that, in 2.2 you could do it by subclassing UITabBarItem and implementing -[UIImage *)selectedImage.

Strictly speaking you are not calling private API, since selectedImage is not a reserved method name (and is actually a fairly reasonable name for someone to use themselves). Having said that, I am sure this is not intended and it could break at any time in a future release. It wouldn't shock me if this was already broken in 3.x (I never shipped anything that did this, just experimented with it for a client).

Related Topic