iOS 6: Parent modal's modalPresentationStyle ignored after rotation

こ雲淡風輕ζ 提交于 2019-12-03 01:04:23

Not sure if this should be considered as a bug and I'm curious what iOS 7 will bring, but the current workaround for this issue is to set modalPresentationStyle to UIModalPresentationCurrentContext for the child-viewController.

Set modalPresentationStyle = UIModalPresentationCurrentContext

This makes the child still beeing presented as FormSheet but prevents the parent from beeing resized to fullscreen on rotation.

Dirk

I can see 2 problems here.

1) in iOS 6 the method presentModalViewController:animated: is deprecated, try using presentViewController:animated:completion: (despite this might not help, you still may want to do it)

2) In iOS 6 somehow appeared that container controllers (such as UINavigationController) don't resend the autorotate messages to their children. Try subclassing the UINavigationController and redefine the corresponding autorotation methods to be sent to all of the children. This might help.

DjimOnDev

You need to instanciate your navigation controller after your main view. So that you will be able to manage rotation in each view.

If your AppDelegate RootViewController is a navigation controller, you will not be able to manage rotation with native functions.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!