我刚刚开始了使用Xcode创建应用程序的教程iOS 7.0+
。
但是,当我运行应用程序并在iOS模拟器中旋转设备时,应用程序的位置在纵向模式下保持固定,而屏幕的确更改为横向尺寸。显然,这应该不会发生,因为它只适用于本教程。
有人可以帮我解决这个问题吗?
编辑1:我已勾选所有方框,这无济于事。我也添加了代码
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
if ( interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight || interfaceOrientation == UIInterfaceOrientationPortrait)
return YES; // for supported orientations
return NO;
}
也不执行任何操作,我也已经注意到一个数组supported interface orientation
已经存在。也许问题是iOS模拟器
编辑2:
对不起,我的愚蠢,由于某种原因,iOS的旋转锁定处于打开状态...谢谢大家
发生这种情况是因为您没有为应用设置横向。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句