首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在iPad 10 SWIFT3.0 Xcode 8.2中停止景观旋转

如何在iPad 10 SWIFT3.0 Xcode 8.2中停止景观旋转
EN

Stack Overflow用户
提问于 2016-12-23 05:34:51
回答 1查看 2K关注 0票数 4

我知道这是重复的问题,但我找不到这个问题的解决办法。我已将Info.plist文件中的“计算更改”设置为“停止旋转景观模式”。

代码语言:javascript
复制
Supported interface orientations (iPad)

上面的键值只保留了肖像,然后我检查了iPad,它工作得很好,但是当我上传到应用程序商店时,它会产生如下错误

代码语言:javascript
复制
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'."

多任务支持需要景观定向,我编写了下面的代码来覆盖旋转方法,但当屏幕旋转时不调用它。

代码语言:javascript
复制
extension UINavigationController {
    public override func supportedInterfaceOrientations() -> Int {
        return visibleViewController.supportedInterfaceOrientations()
    }
    public override func shouldAutorotate() -> Bool {
        return visibleViewController.shouldAutorotate()
   }
}

并尝试设置navigationController对象的直接值,然后给出错误:

只读属性不能赋值。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-12-23 07:05:24

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

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

票数 9
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41295708

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档