iPhone 5 TabBar not functioning in proper position

前端 未结 3 1096
忘掉有多难
忘掉有多难 2020-12-17 15:01

I am updating our app and I have added the new default image but my tab bar was not working on the iPhone 5. I did some research and created an if statement checking for the

相关标签:
3条回答
  • 2020-12-17 15:29

    This happens due to screen height issue between iPhone 5 and iPhone 4. Add below snippet in AppDelegate file. This solved my problem.

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
      self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];    
    }
    
    0 讨论(0)
  • 2020-12-17 15:39

    Check the "Full Screen at Launch" option for your main window in Interface Builder.

    enter image description here

    If you want to do it without Interface Builder, add

    window.frame = [UIScreen mainScreen].bounds;
    

    at the start of your applicationDidFinishLaunching: or application:didFinishLaunchingWithOptions: in the app delegate.

    0 讨论(0)
  • 2020-12-17 15:44

    If your window is being created in an older nib there is most likely a checkbox that needs to be checked on the windows attributes titled "full screen at launch"

    More info here.

    0 讨论(0)
提交回复
热议问题