iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews. -(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; [self.tabBar invalidateIntrinsicContentSize]; } Note: The bottom of the tab bar will need to be contained to the bottom of the main view, rather than the safe area, and the tab bar should have no … Read more

automaticallyAdjustsScrollViewInsets not working

I think that automaticallyAdjustsScrollViewInsets only works when your controllers view is a UIScrollView (a table view is one). You’re problem seems to be that your controller’s view is a regular UIView and your UITableView is just a subview, so you’ll have to either: Make the table view the “root” view. Adjust insets manually: UIEdgeInsets insets … Read more

Moving UITabBarItem Image down?

Try adjusting tabBarItem‘s imageInsets (for moving the icon image) and setting the controllers title to nil (so no title is displayed). Put something like this to -init or -viewDidLoad method in view controller: Objective-C self.tabBarItem.imageInsets = UIEdgeInsetsMake(6, 0, -6, 0); self.title = nil; Swift self.tabBarItem.imageInsets = UIEdgeInsets(top: 6, left: 0, bottom: -6, right: 0) self.title … Read more

Positioning UITabBar at the top

Is it possible? Sure, but it violates the human interface guidelines. Screenshots: Code: TabController.h: #import <UIKit/UIKit.h> @interface TabController : UITabBarController <UITabBarControllerDelegate> @end TabController.m: #import “TabController.h” @interface TabController () @end @implementation TabController – (void)viewDidLoad { [super viewDidLoad]; self.delegate = self; } – (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; [self.tabBar invalidateIntrinsicContentSize]; CGFloat tabSize = 44.0; UIInterfaceOrientation orientation = [UIApplication … Read more

Detect when a tab bar item is pressed

You don’t want your view controller’s base class to be a UITabBarDelegate. If you were to do that, all of your view controller subclasses would be tab bar delegates. What I think you want to do is to extend UITabBarController, something like this: class MyTabBarController: UITabBarController, UITabBarControllerDelegate { then, in that class, override viewDidLoad and … Read more

Change UITabBar height

I faced this issue and I was able to solve it. You have to add following code to your subclass of UITabBarController class. const CGFloat kBarHeight = 80; – (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; CGRect tabFrame = self.tabBar.frame; //self.TabBar is IBOutlet of your TabBar tabFrame.size.height = kBarHeight; tabFrame.origin.y = self.view.frame.size.height – kBarHeight; self.tabBar.frame = tabFrame; } … Read more