iphone5 compatibility tab bar coming 88 points above bottom line of screen

安稳与你 提交于 2019-12-11 01:54:13

问题


I have added iPhone 5 compatibility by adding the default-568h@2x.png However, the tab bar in my application does not come in the bottom as should be expected.

This tab bar is added via tabbarController in mainWindow.xib.

NOTE: the bottom black part is clickable, but my view does not stretch itself to fit the screen. I have tried the following already: 1) [window setFrame:[[UIScreen mainScreen] bounds]]; 2) setting freeform/retina 4 inch display in xib 3) setting full screen at launch for window form xib 4) Removing mainwindow.xib and coding tabbarcontroller as the rootviewcontroller of window

EDIT: Code in appDidFinishLaunching:

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:    (NSDictionary *)launchOptions {
    //self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    [self.window setFrame:[[UIScreen mainScreen] bounds]];
   // [self tabbar];
    self.tabBarController.view.backgroundColor = [UIColor blackColor];
   // self.tabBarController.view.autoresizingMask = UIViewAutoresizingFlexibleBottomMargin;
    self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}

MainWindow.xib looks like:


回答1:


Your launch image has the wrong name: Instead of default-568h@2x.png it should be Default-568h@2x.png (note the uppercase D). The file name is case sensitive.




回答2:


My Bad!..I was using some APIs to show/hide tab bar. Those APIs had hardcoded 480 specified for y. oopsies!



来源:https://stackoverflow.com/questions/13582531/iphone5-compatibility-tab-bar-coming-88-points-above-bottom-line-of-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!