How to get proper UIInterfaceOrientation from a nested UIViewController
When I place a view controller's view inside a top level view controller, the UIInterfaceOrientation
I get from the nested view controller is incorrect. If I get the orientation from the top level view controller, I get the co开发者_Python百科rrect one. The interfaceOrientation
property is readOnly, so I can't simply set it. How can I get my nested view controller to recognize the proper orientation?
Apple may not recommend using nested view controllers, but I'm using them for re-usability (Universal app).
I have had this issue quite a bit as well, and the only fix i have found is to either call the child view's willRotateToOrientation: method whenever you call the parents, or if you want to check when you load, to do something like [[view2.superview viewController] imageOrientation]
basically you have to handle it yourself and its a pain.
精彩评论