Reputation: 831
I have an app which was previously designed in 2014. Now I have to make the app design compatible with iPhone X.
When i run the app on iPhone X simulator everything works fine except the tab bar. The tab bar height gets increased in iPhone X simulator.
I know the basic safe area guide thing but for now i don't to fill the top and bottom empty areas, i just to display the standard tab bar as it displays on the other iPhones.
The tab bar is added programmatically so i tried to change its height as following
tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
self.tabBarController.viewControllers = [[NSArray alloc] initWithObjects:trailsNavController,mapNavController, gpsNavController,infoNavController, signUpNavController, nil];
self.tabBarController.delegate = self;
self.tabBarController.tabBar.frame = CGRectMake(self.tabBarController.tabBar.frame.origin.x, self.tabBarController.tabBar.frame.origin.y, self.tabBarController.tabBar.frame.size.width, 40);
self.window.rootViewController = self.tabBarController;
The app design gets distorted when i add splash screen.
Any other way to change its height? Any help would be appreciated.
Upvotes: 0
Views: 954
Reputation: 1544
You should use proportional height. For example:
self.tabBarController.tabBar.frame = CGRectMake(self.tabBarController.tabBar.frame.origin.x, self.tabBarController.tabBar.frame.origin.y, self.tabBarController.tabBar.frame.size.width, self.view.frame.size.height/6);
Upvotes: 0