最近,我在xcode 6.3中使用swift开发了一个应用程序。
应用程序支持景观模式下的iPhone和iPad (右和左)
我已经设置了
支持的界面定向

在info.plist到landscapeRight,并离开ipad,iphone和通用
在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发生了什么事吗?
tnx for adv
发布于 2015-05-12 07:37:06
您将在Deployment部分中找到“横向左”和“景观右”复选框

https://stackoverflow.com/questions/30184440
复制相似问题