仅限肖像模式 - iOS

3 uiinterfaceorientation ios ios5 ios6

我有一个应用程序,仅用于纵向方向.但是,我不知道如何限制只使用纵向模式,一旦用户颠倒或空间模式,我不希望我的屏幕orinetation相应地改变.

有什么想法怎么做?

LJ *_*son 7

这可以通过覆盖此方法在App Summary(以及rootviewcontroller中,无论是Nav控制器,TabBar控制器等)中指定:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述