Orientations
作者:
iVikings | 来源:发表于
2021-12-27 19:08 被阅读0次import Foundation
import UIKit
extension UINavigationController {
open override var shouldAutorotate: Bool {
if let vc = self.viewControllers.last {
return vc.shouldAutorotate
}
return false
}
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if let vc = self.viewControllers.last {
return vc.supportedInterfaceOrientations
}
return UIInterfaceOrientationMask.portrait
}
}
extension UITabBarController {
open override var shouldAutorotate: Bool {
if let select = self.selectedViewController {
return select.shouldAutorotate
}
return false
}
open override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if let select = self.selectedViewController {
return select.supportedInterfaceOrientations
}
return UIInterfaceOrientationMask.portrait
}
}
本文标题:Orientations
本文链接:https://www.haomeiwen.com/subject/bhoyqrtx.html
网友评论