比赛获胜';t在iOS 8/iPhone上自动旋转

比赛获胜';t在iOS 8/iPhone上自动旋转,ios,iphone,Ios,Iphone,我有一款只支持风景的游戏,可以在以下情况下自动旋转: <key>UISupportedInterfaceOrientations</key> <array> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array>

我有一款只支持风景的游戏,可以在以下情况下自动旋转:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~iphone</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
  • iOS 6上有iPad吗+
  • iOS 7上的iPhone4S
但不是关于:

  • iOS 8上的iPod 5
  • iOS 8上的iPhone 5S
  • iOS 8上的iPhone 6/6+
这些是我可以访问的配置。我使用的故事板只有一个UI视图填充屏幕,没有自动布局或任何东西。以下代码位于我的视图控制器中:

-(BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}
旋转时,在所有设备上都会按预期调用此函数。在iPad上,我可以看到willRotateToInterfaceOrientation:duration:和didRotateFromInterfaceOrientation:被调用。这些方法从未在我的iOS 8手机上触发。我的plist包括以下内容:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~iphone</key>
<array>
    <string>UIInterfaceOrientationLandscapeLeft</string>
    <string>UIInterfaceOrientationLandscapeRight</string>
</array>

您的第一个
UISupportedInterfaceOrientation
键列表
UIInterfaceOrientation和scapeLeft
两次。那是网站上的错别字,还是你的文件里的错别字?复制粘贴错别字,我已经改正了。如果实际的代码能让我这么简单就好了。。。。