首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LandScape在iPhone上的定位不能正常工作

LandScape在iPhone上的定位不能正常工作
EN

Stack Overflow用户
提问于 2015-05-12 07:29:13
回答 1查看 441关注 0票数 1

最近,我在xcode 6.3中使用swift开发了一个应用程序。

应用程序支持景观模式下的iPhone和iPad (右和左)

我已经设置了

支持的界面定向

在info.plist到landscapeRight,并离开ipad,iphone和通用

在iPad中,它的工作是正确的,但在iPhone中,只有一种景观模式工作,旋转装置时不会改变。

此外,我还将此添加到appDelegate中

代码语言:javascript
复制
func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> Int
    {
        return Int(UIInterfaceOrientationMask.Landscape.rawValue)
    }

但不工作

并将代码添加到根ViewController

代码语言:javascript
复制
override func shouldAutorotate() -> Bool
    {
        return true
    }

    override func supportedInterfaceOrientations() -> Int
    {

        return Int(UIInterfaceOrientationMask.LandscapeRight.rawValue | UIInterfaceOrientationMask.LandscapeLeft.rawValue)
    }

    override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation
    {
        return UIInterfaceOrientation.LandscapeRight
    }

但也不要工作

有人知道iPhone发生了什么事吗?

tnx for adv

EN

回答 1

Stack Overflow用户

发布于 2015-05-12 07:37:06

  1. 在中选择项目
  2. 点击目标列表中的目标
  3. 选择"General“选项卡

您将在Deployment部分中找到“横向左”和“景观右”复选框

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

https://stackoverflow.com/questions/30184440

复制
相关文章

相似问题

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