Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nnavick

macrumors regular
Original poster
Oct 13, 2010
100
0
Hi'
I want to add an color image to my tab bar but when I'm adding my image it's turn to gray and put it over the title even the title is "".

how can I add a color image to the tab bar and make it all over the tab?

Thank you
 
UITabBarItem's image cannot contain color (in fact, as the doc states, "The alpha values in the source image are used to create the unselected and selected images"). You may be able to hack in your own subviews or you'll have to roll your own tab bar.
 
You may be able to hack in your own subview...
Meaning: UITabBar is a subclass of UIView. Therefore, you can add your own subviews.

...or you'll have to roll your own tab bar.
Meaning: You might be able to subclass UITabBar and customize it to meet your specific needs or you could create a whole new custom class that operates similar to a UITabBar but created by you from scratch. For example, RCSwitch is a customized UISwitch but rather than subclassing UISwitch and extending it, they actually subclassed UIView.
 
[self.tabBarController addSubview:myimage];

: Semantic Issue: 'UITabBarController' may not respond to 'addSubview:'

what should I do?
 
I tied both and it's gave the same warning

EDIT:

Figured it out

thank you
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.