iPhone SDK: Orientation (Landscape and Portrait views)

后端 未结 5 1992
醉梦人生
醉梦人生 2020-12-02 19:38

Okay, I\'ve got my normal app which is in portrait mode. I can force my app to go to landscape mode for a view (using navigationcontroller and viewcontroller) like this:

5条回答
  •  暖寄归人
    2020-12-02 20:06

    You can't use this private API.

    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

提交回复
热议问题