Reputation: 1227
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.
Upvotes: 1
Views: 1773
Reputation: 107131
If you are using iOS 5
or greater you can use setBackgroundImage
:
UITabBar *yourtabBar = [yourtabController tabBar];
[yourtabBar setBackgroundImage:[UIImage imageNamed:@"tabbar.jpg"]];
Upvotes: 0
Reputation: 4329
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];
Upvotes: 2