开发者

shouldAutorotateToInterfaceOrientation and UINavigationController

I've got a UINavigationController with a bunch of view controllers stacked on it. Not all of the view controller's orientations are compatible. For example, I've got one landscape view that I push a portrait view on top of. shouldAutoRotateToInterfaceOrientation gets called asking for landscape, i return NO but it goes to landscape anyway. Now in this view if i then rotate to portrait, it rotates and is stuck there (as it should be to begin with). But when i pop the view, the view u开发者_开发技巧nderneath it which was in landscape is now in portrait which it shouldn't be!

WTF??????????????????

workarounds? advice? solutions? anything?

iOS 4.1


It seems this was a bug with UINavigationController. I wound up using some modal view controllers for the top-stack items instead of pushing them on the stack. This fixed my issue.


The problem is that the call to methods like shouldAutoRotate is sent to the navigation controller not the views in the stack. You have a choice either to do everything at the nav controller level or to do what you did and switch to modal segues.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜