Trick preferredInterfaceOrientationForPresentation to fire on viewController change

前端 未结 2 1235
天命终不由人
天命终不由人 2021-01-18 04:49

I am using MSNavigationPaneViewController from here and have rotation sort of working. I\'ve overridden the rotation methods in my root UINavigationContro

2条回答
  •  庸人自扰
    2021-01-18 05:26

    preferredInterfaceOrientationForPresentation will not be called on controllers within a UINavigationController.

    You are going to have to subclass UINavigationController and then implement this feature yourself. You'd simply want to delegated to topViewController.

    For reference check out: http://code.shabz.co/post/32051014482/ios-6-supportedorientations-with-uinavigationcontroller

    I also found this implementation of a UINavigationController subclass: https://gist.github.com/3842178

提交回复
热议问题