[英]LandScape Orientation on iPhone Not Work Correctly
最近我在xcode 6.3中使用swift開發了一個應用程序。
應用程序支持橫向模式下的iPhone和iPad(左右)
我已經設定了
支持的接口方向
在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
您將在“部署信息”部分中找到“左橫向”和“右橫向”復選框
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.