Hide tab bar item and align other tabs

In my application, I have 4 tab bar items. I am adding these 4 tab bar items to the XIB file.

Initially, I need to show 3 elements of the tab bar, and after synchronization, I have to show the 4th tab item in my application. Therefore, for this, I hide the 4th tab element using the following code.

[[[self.tabBarController.tabBar subviews] objectAtIndex:03 setHidden:YES];

The tab element is hidden, but instead of the hidden element, I have empty space. Is it possible to align the other 3 elements in the full tab bar. The thing is, I don’t want to show empty space or empty space in the tab bar.

Thanks Jithen

+5
source share
1 answer

, tabBar , , . :

NSMutableArray *controllers = [NSMutableArray arrayWithArray:self.tabBarController.viewControllers];
[controllers removeObjectAtIndex:3];
[self.tabBarController setViewControllers:controllers animated:YES];
+6

All Articles