ios - 如何在应用程序加载前将我的 iPad 设置为横向模式?

标签 ios xcode ipad uiinterfaceorientation

我有一个只有横向的应用程序,当我在 iPad 模拟器上测试它时,设备以纵向模式启动,并在应用程序加载后转为横向模式,并弄乱了我的应用程序的整个布局。我怎样才能让 ipad 在应用程序加载之前进入横向模式,因为它弄乱了我的布局?这是我在 GameViewController 中使用的代码:

override func shouldAutorotate() -> Bool {
    return true
}

override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
    let orientation: UIInterfaceOrientationMask =
        [UIInterfaceOrientationMask.Landscape, UIInterfaceOrientationMask.Landscape]
        return orientation
}

最佳答案

开始工作 我进入了我的 info.plist 文件并删除了 Supported interface orientations(iPad) 的肖像。

关于ios - 如何在应用程序加载前将我的 iPad 设置为横向模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37127847/

相关文章:

ios - 如何构建一个 react native 应用程序,以便它在 ipad 上作为 ipad 应用程序运行?

iphone - 如何获取 UIImage 中使用的图像名称?

ios - 嵌套 NSArray 的 UITableView 中的不同部分标题

ios - 如何使用 Objective-C 初始化嵌套的 Node.js 模式

ios - Swift - 实例化新 View Controller 时如何保留对旧 View Controller 的引用?

iphone - TestFlight 不接受我的 FlightPath 版本 IPA。担心的原因?

iOS核心数据: Fetch child Magical Record data

ios - Xcode 6 在验证或提交应用存档时崩溃

Xcode 项目损坏,卡住,同时 'Scanning Classes'

ios - containerURLForSecurityApplicationGroupIdentifier 获得零值