I created a TabBar for all iphone but in iphone 5 showing properly but in iphone 6 not showing properly image iPhone 6 showing like that i want proper spacing between tabbaritem and left and right
in Iphone 5 showing properly
I am using this code
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
UITabBar *tabBar = self.tabBar;
[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"footer_bg"]];
[[UITabBar appearance] setTintColor:[UIColor clearColor]];
[[UITabBar appearance] setTintColor:[UIColor clearColor]];
self.delegate=self;
self.imgTab1= getImgViewForTab(CGRectMake(0, 6, 80, 39), @"listings_active.png");
self.imgTab1.autoresizesSubviews = YES;
self.imgTab1.autoresizingMask = LEFT_MARGIN & TOP_MARGIN & BOTTOM_MARGIN & F_WIDTH & F_HEIGHT;
[tabBar addSubview:self.imgTab1];
self.imgTab2= getImgViewForTab(CGRectMake(80, 6, 80, 39), @"bids.png");
self.imgTab2.autoresizesSubviews = YES;
self.imgTab2.autoresizingMask = TOP_MARGIN & BOTTOM_MARGIN & F_WIDTH & F_HEIGHT;
[tabBar addSubview:self.imgTab2];
self.imgTab3= getImgViewForTab(CGRectMake(160, 6, 80, 39), @"reservations.png");
self.imgTab3.autoresizesSubviews = YES;
self.imgTab3.autoresizingMask = TOP_MARGIN & BOTTOM_MARGIN & F_WIDTH & F_HEIGHT;
[tabBar addSubview:self.imgTab3];
self.imgTab4= getImgViewForTab(CGRectMake(240, 6, 80, 39), @"settings.png");
self.imgTab4.autoresizesSubviews = YES;
self.imgTab4.autoresizingMask = RIGHT_MARGIN & TOP_MARGIN & BOTTOM_MARGIN & F_WIDTH & F_HEIGHT;
[tabBar addSubview:self.imgTab4];
[self setSelectedTabImage:tabbarindexG];
}