【问题标题】:Forcing rotation to landscape强制旋转到横向
【发布时间】:2011-03-10 04:31:06
【问题描述】:

我希望我的应用的旋转固定为横向...

我做了一些研究,但大多数帖子都是关于检测变化的,

我找不到任何关于强制执行的内容。

谁能帮帮我?

【问题讨论】:

    标签: iphone uiview autorotate


    【解决方案1】:

    试试这个

    在 plist 中将支持的界面方向更改为 Lansdscape

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); // home button on right
    }
    

    一切顺利

    【讨论】:

      【解决方案2】:

      您可以更改项目的 info.plist,以便您的应用最初始终显示横向。然后您可以使视图控制器仅支持横向。

      希望这也有帮助

      Only support for landscape Interface orientation

      Launching application in landscape orientation for IPad

      【讨论】: