Syed e Hussaini Syed e Hussaini - 1 year ago 105
Objective-C Question

Tabbar Background image is not perfectly placing

I have a

i want to change its background image when i change the background image to using this code

self.tabBar setBackgroundImage:[UIImage imagenamed:@"texture.jpg"]];

Instead of changing the
background image it changes the whole screens background image.

Change Image of Red Rectangular Box Below
Image2 Screenshot

Answer Source

Use this code in your AppDelegate after setting tabBarController as rootViewController

UITabBarItem *item = [self.tabBarController.tabBar.items objectAtIndex:0];
item.image = [UIImage imageNamed:@"YourDeselectImage.png"];
item.selectedImage = [UIImage imageNamed:@"YourSelectImage.png"];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download