xcode - iOS 5屏幕初始自动旋转

标签 xcode ios5 autorotate

我知道自从ios 6发布以来,苹果已经改变了所有设置屏幕自动旋转的功能。我已经能够应用这些更改,但自从我开始使用最新的 xcode 版本以来,我的所有应用程序在 ios 5 中启动时都不会自动旋转到某个方向。我的理解是,为了支持自动旋转从 ios 5 开始旋转,您只需保留进行自动旋转的功能,我有:

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    BOOL allowed = NO;
    if(interfaceOrientation == UIInterfaceOrientationLandscapeLeft){
    allowed = YES;
    }
    return allowed;
}

我的问题是,当应用程序在模拟器中启动时,它会自动以纵向显示,但是当我将模拟器旋转到横向左侧时,它会自动旋转,然后不会自动旋转回去。为什么模拟器不自动将应用程序的显示旋转为横向?运行 iOS 5 或 5.1 的设备上也会出现这种情况吗?

编辑

我还注意到这个问题出现在ios 5和5.1模拟器中,但没有出现在ios 4.3模拟器中

最佳答案

确保支持的方向仅为横向,因为模拟器将在启动时检查这些值。这可以在 XcodeProject->Summary 选项卡中找到,或者您可以直接在 info.plist 文件中编辑它。希望有帮助!

关于xcode - iOS 5屏幕初始自动旋转,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14091029/

相关文章:

swift - TextBox 在堆栈 View Xcode 中拉伸(stretch)

ios - 在 iOS 表格中显示响应图像和标签

iphone - iOS 应用程序在临时安装后设备重新启动之前不会运行

xcode - NSURLConnection 发送异步请求 :queue:completionHandler: doesn't call delegate method - didReceiveAuthenticationChallenge

ios - SpriteKit,如何将实时摄像机放置在后台

ios - 字典给出不正确的值

iphone - UITextFields 不工作

uisplitviewcontroller - UiSplitViewController不会自动旋转

flutter - 找不到错误404页面/profileScreen

android - 可穿戴设备根据方向旋转屏幕