[英]LandScape Orientation on iPhone Not Work Correctly

recently i develop an application using swift in xcode 6.3.
application support iPhone and iPad in landscape Mode (Both Right and Left)
i have set the

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

supported Interface Orientation


info.pList Screenshot in info.plist to landscapeRight and Left for ipad,iphone and universal
in iPad its work Correctly but in iPhone just one Landscape mode Work and dont change when Rotating Device
also i add this to appDelegate

在info.plist到landscapeRight和Left for ipad,iphone和Universal在iPad上它的工作正確但在iPhone中只有一個橫向模式工作並且在旋轉設備時也不會改變我將它添加到appDelegate

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

but not work
and adding the code to root 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

but dont work either
any body know whats going on in iPhone?
tnx for adv

但是,任何人都不知道iPhone上發生了什么事嗎? tnx for adv

1 个解决方案


  1. In the Project Navigator select your project
  2. 在Project Navigator中選擇您的項目

  3. Tap your target in the target list
  4. 在目標列表中點按目標

  5. Select the "General" tab
  6. 選擇“常規”選項卡

You will find the "Landscape Left" and "Landscape Right" checkboxes in the Deployment Info section

您將在“部署信息”部分中找到“Landscape Left”和“Landscape Right”復選框

enter image description here



粤ICP备14056181号  © 2014-2021 ITdaan.com