【发布时间】:2017-06-18 23:19:47
【问题描述】:
我正在使用 Spritekit 在 iOS 中创建游戏,并且我希望我的游戏仅是横向的。但是,每次我在模拟器中测试我的游戏时,无论我尝试什么,它总是以纵向加载。我已经阅读了很多关于这个问题的堆栈溢出帖子,我尝试了以下方法但没有成功:
游戏视图控制器
override var shouldAutorotate: Bool {
return false
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
return [UIInterfaceOrientationMask.landscapeLeft, UIInterfaceOrientationMask.landscapeLeft]
}
请注意,我也尝试将 Autorotate 从 true 切换为 false。这也不起作用。
Xcode 工程文件
Info.plist
这些都没有用
【问题讨论】:
-
你的 Xcode 版本是多少?如果您在 macOS X 10.2.x 下使用 Xcode 8.3.x,则可能存在错误。
-
@ElTomato Xcode 9 beta Swift 4
标签: ios swift xcode ios-simulator