在我的应用程序的构建设置中,我已经检查了所有支持的方向(除了倒置)。iOS:防止切换时查看方向?
但是,当我启动应用程序时,某些视图不能用纵向显示,将自动旋转并截断视图的一半。我不希望这些视图旋转。
我该如何预防? ive试过使用:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft)
return YES;
if(interfaceOrientation == UIInterfaceOrientationLandscapeRight)
return YES;
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
但是,该设备仍然想要时,它可以变成肖像。任何帮助都会很棒。
http://stackoverflow.com/questions/2868132/shouldautorotatetointerfaceorientation-doesnt-work – prashanth