-->

iphone5 compatibility tab bar coming 88 points abo

2019-07-21 16:35发布

问题:

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!