1

我有一个 ViewController,我有这个代码:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

    return NO;

}

但是,如果我改变方向,视图会旋转。任何人都可以帮助我吗?

4

1 回答 1

0

以下是我如何将 iPad 保持在横向模式:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
{
    return YES;
}

else
{
    return NO;
}

}
于 2012-06-07T00:21:04.963 回答