簡體   English   中英

iPhone上的LandScape方向無法正常工作

[英]LandScape Orientation on iPhone Not Work Correctly

最近我在xcode 6.3中使用swift開發了一個應用程序。
應用程序支持橫向模式下的iPhone和iPad(左右)
我已經設定了

支持的接口方向

info.pList截圖 在info.plist中,針對ipad,iphone和Universal的landscapeRight和Left
在iPad中可以正常工作,但在iPhone中只能使用一種橫向模式,並且在旋轉設備時不會更改
我也將此添加到appDelegate

func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> Int
    {
        return Int(UIInterfaceOrientationMask.Landscape.rawValue)
    }

但不起作用
並將代碼添加到根ViewController

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中發生了什么嗎?
用於adv的tnx

  1. 在項目瀏覽器中選擇您的項目
  2. 在目標列表中點擊目標
  3. 選擇“常規”標簽

您將在“部署信息”部分中找到“左橫向”和“右橫向”復選框

在此處輸入圖片說明

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM