我有一个ViewController,我在那里有这个代码:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return NO;
}
但是,如果我更改方向,视图会旋转。有人可以帮助我吗?
答案 0 :(得分:0)
以下是我如何将iPad保持在横向模式:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
{
return YES;
}
else
{
return NO;
}
}