setStatusBarOrientation:animated: not working in iOS 6

后端 未结 3 692
余生分开走
余生分开走 2020-12-05 08:50

I\'ve used this code to force an orientation change back to portrait when the user is finished watching the video (it allows viewing in landscape mode), before popping the v

相关标签:
3条回答
  • 2020-12-05 09:33

    setStatusBarOrientation method has changed behaviour a bit. According to Apple documentation:

    The setStatusBarOrientation:animated: method is not deprecated outright. It now works only if the supportedInterfaceOrientations method of the top-most full-screen view controller returns 0

    0 讨论(0)
  • 2020-12-05 09:38

    Your root view controller should answer false to the method shouldAutorotate in order that your app responds to setStatusBarOrientation:animated

    From Apple Documentation: "if your application has rotatable window content, however, you should not arbitrarily set status-bar orientation using this method"

    To understand that, put a breakpoint in the shouldAutorotate method and you will see that it is called juste after setting the status bar orientation.

    0 讨论(0)
  • 2020-12-05 09:40

    Here is how I fixed.

    https://stackoverflow.com/a/14530123/1901733

    The current question is linked with the question from the url above.

    The statusBarOrientation is a real problem in ios6.

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