I am using UITabBarController and want to add image to it, a whole image to tab bar, not to any tab item. Is it possible, can anyone guide. Thanks in advance.
Asked
Active
Viewed 1,769 times
1
-
already solved check [this link][1] [1]: http://stackoverflow.com/questions/8709802/custom-tab-bar-background-image-in-ios-4-x – Harshal Chaudhari Dec 29 '12 at 08:08
-
This is of tab bar i am asking for tab bar controller – iPhone Programmatically Dec 29 '12 at 09:32
2 Answers
2
Try this. May be it help
UIImage *tabBackground = [[UIImage imageNamed:@"Your Image"]
resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
// Set background for all UITabBars
[[UITabBar appearance] setBackgroundImage:tabBackground];
// Set background for only this UITabBar
[[tabBarController tabBar] setBackgroundImage:tabBackground];

Wolverine
- 4,264
- 1
- 27
- 49
0
If you are using iOS 5
or greater you can use setBackgroundImage
:
UITabBar *yourtabBar = [yourtabController tabBar];
[yourtabBar setBackgroundImage:[UIImage imageNamed:@"tabbar.jpg"]];

Midhun MP
- 103,496
- 31
- 153
- 200
-
question is about to add image to UITabBarController. I think you have to modify your ans. little bit. – kushalrshah Dec 29 '12 at 08:10