ang*_*dev 7 uitabbarcontroller ipad ios swift swift2
我有一个UITabBarController子类,它具有以下代码:
class TabBarController: UITabBarController {
// MARK: Methods
override func viewDidLoad() {
super.viewDidLoad()
}
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
print(self.selectedIndex)
if self.selectedIndex == 1 {
return .Portrait
}
return .All
}
}
Run Code Online (Sandbox Code Playgroud)
该功能supportedInterfaceOrientations仅在我从iphone执行应用程序时调用.如果我从我的iPad mini执行该应用程序,则不会调用它.知道这种行为的原因吗?
ang*_*dev 40
这很奇怪,但是如果我取消选择Upside DowniPad的设备方向supportedInterfaceOrientations就会被调用.
更新:
如果"需要全屏幕"从"常规"设置为启用,将允许定向委托方法shouldAutorotate,preferredInterfaceOrientation和supportedInterfaceOrientations射击.
| 归档时间: |
|
| 查看次数: |
4266 次 |
| 最近记录: |