GameCenter authentication in landscape-only app throws UIApplicationInvalidInterfaceOrientation

前端 未结 5 1480
抹茶落季
抹茶落季 2020-11-29 06:38

Problem: If user is not logged into GameCenter account - GameCenter authentication view is launched in portrait mode (in ios 5 there were a modal dialog) asking to log in. B

5条回答
  •  伪装坚强ぢ
    2020-11-29 07:13

    While writing this question and experimenting with code, it seems that I've found a solution: enable all orientations in project summary and remove application:supportedInterfaceOrientationsForWindow.

    Add this code to ViewController:

    - (NSUInteger)supportedInterfaceOrientations {
        return UIInterfaceOrientationMaskLandscape;
    }
    

    Now it works seamlessly.

提交回复
热议问题