如何禁用后(父)VC自动旋转?

时间:2018-11-08 11:58:35

标签: swift uiviewcontroller

let navVC = UINavigationController(rootViewController: destinationVC)
navVC.modalPresentationStyle = .overFullScreen
viewController?.present(navVC, animated: true, completion: nil)

此块之后,在屏幕上显示了可以自动旋转的vc。但是出现navVC的vc也会自动旋转。如何解决此错误?

代码AppDelegate:

  func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
    let presentedViewController = UIHelper.topViewController()

    if presentedViewController is FullOrientationRotate {
      print("presentedViewController is ", presentedViewController)
      return .all
    }
    return .portrait
  }

0 个答案:

没有答案
相关问题