我试图在某些视图控制器中禁用和启用屏幕旋转,但是它不起作用,出现错误“使用未声明的标识符'shouldAutorotateToInterfaceOrientation”“我使用IOS 8,我会错过什么?
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
将您的应用设置为旋转以定向,并且在您希望视图旋转的每个ViewController中,对其余视图控制器返回YES和No。
(BOOL)应该自动旋转{返回否;}
(NSUInteger)supportedInterfaceOrientations {return UIInterfaceOrientationMaskPortrait; }
一旦设置了应用程序方向,它将保留方向权限,并且无法在应用程序的中间进行更改,因此您必须在所有ViewController中单独执行额外的任务。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句