How to force a screen orientation in specific view controllers?

前端 未结 4 723
猫巷女王i
猫巷女王i 2020-12-16 14:06

My application is pretty simple: it starts up with a view controller that holds a table view (in grouped view layout) with a few options. When the user taps on one of the op

4条回答
  •  隐瞒了意图╮
    2020-12-16 14:28

    There is a solution to do that : it's to use a view controller and adding its view to the window. then in that controller you force landscape in the shouldAutorotate... methode. It works fine, but be sure it's necessary for your project to use that, because it's not very smart  to force the user to turn his iPhone. By the way, here is an example code if you need it.

    http://www.geckogeek.fr/iphone-forcer-le-mode-landscape-ou-portrait-en-cours-dexecution.html

提交回复
热议问题