Launching into portrait-orientation from an iPhone 6 Plus home screen in landscape orientation results in wrong orientation

前端 未结 13 1694
南方客
南方客 2020-12-22 23:21

The actual title for this question is longer than I can possibly fit:

Launching an app whose root view controller only supports portrait-orientation but which otherw

13条回答
  •  春和景丽
    2020-12-22 23:45

    I had a similar issue is with my app runs both in landscape and portrait with a UITabBarController as root view controller.

    Whenever the app was launched when in Landscape mode, the view was incorrect.

    All I had to do: - remove rootview controller assignment in the XIB. - Manually add it in once the app is launched:


    • (void)applicationDidFinishLaunching:(UIApplication *)application { application.statusBarHidden = YES;

      [self.window setRootViewController:self.tabBarController];


    That fixed the problem.

提交回复
热议问题