iOS 6中,shouldAutorotateToInterfaceOrientation
已被弃用。我尝试使用supportedInterfaceOrientations
和shouldAutorotate
来使应用程序在自动旋转时正常工作,但失败了。
我不希望这个视图控制器旋转,但它不起作用。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
有什么想法吗? 非常感谢您提前的帮助!