【问题标题】:How to stop landscape rotation in iPad in iOS 10 Swift 3.0 Xcode 8.2如何在 iOS 10 Swift 3.0 Xcode 8.2 中停止 iPad 中的横向旋转
【发布时间】:2016-12-23 05:34:51
【问题描述】:

我知道这是重复类型的问题,但我找不到此问题的解决方案。我在 Info.plist 文件中设置了更改以在

下停止旋转横向模式
Supported interface orientations (iPad)

只保留肖像的关键值然后我在 iPad 上检查它工作正常但是当我在应用商店上传时它会给出如下错误

ERROR ITMS-90474: "Invalid Bundle. iPad Multitasking support requires these orientations: 
'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 
'UIInterfaceOrientationPortrait' in bundle 'com.example.demo'."
ERROR ITMS-90474: "Invalid Bundle. iPad Multitasking support requires these orientations: 
'UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight'. Found 'UIInterfaceOrientationPortrait' in bundle 'com.example.demo'."

多任务支持需要横向我已经编写了以下代码来覆盖旋转方法,但在屏幕旋转时它不会调用

extension UINavigationController {
    public override func supportedInterfaceOrientations() -> Int {
        return visibleViewController.supportedInterfaceOrientations()
    }
    public override func shouldAutorotate() -> Bool {
        return visibleViewController.shouldAutorotate()
   }
}

并尝试在 navigationController 对象上设置直接值然后它给出错误:

只读属性不能赋值

【问题讨论】:

    标签: iphone ipad swift3 ios10 xcode8.2


    【解决方案1】:

    问题是您的应用程序支持multitasking,这需要所有界面方向。

    要么支持所有方向,要么只检查以下标志

    【讨论】:

    • 设置为 true 需要全屏...谢谢...@InderKumarRathore
    • 感谢您的帮助:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-29
    • 2013-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多