In my app, i have 4 tab bar items. Iam adding these 4 tab bar items in XIB file.
Initially i have to show 3 tab bar items and after sync i have to show 4th tab bar item in my app. So for this, i am hiding 4th Tab bar item using following code.
[[[self.tabBarController.tabBar subviews] objectAtIndex:03 setHidden:YES];
The tab item is hiding but i am having blank space in place of the hidden item. Is there any chance to align other 3 items in full tab bar. The thing is i dont want to show blank space or empty space in tab bar.
Thanks Jithen
If you want to get the items of the tabBar rearranged you have to remove the controller from the controllers list, not hide it. You can use this code to achieve this:
NSMutableArray *controllers = [NSMutableArray arrayWithArray:self.tabBarController.viewControllers];
[controllers removeObjectAtIndex:3];
[self.tabBarController setViewControllers:controllers animated:YES];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With