Basically, I want to remove the default icons on the UITabBar and only show the titles. Besides, I hope to position the titles of the tab bar at the center of the tab bar, instead of the default one. Does anybody know how to remove the icons and center the titles? Thanks!
Code in Objective-C
self.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Tab1" image:nil selectedImage:nil];
[self.tabBarItem setTitlePositionAdjustment:UIOffsetMake(0, -10)];
As usual this is easier in code than in Interface Builder.
For Swift in XCode 9.0 and Swift 4.0:
self.tabBarItem = UITabBarItem(title: "Your Title", image: nil, selectedImage: nil)
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