开发者

Push UIViewController with different orientation to previous

Probably a simple question, but:

My app starts (and is mostly) in portrait mode, but I have a ViewController which I need to push onto the stack which needs to open in Landscape mode.

I've searched around and found that you can't use the private API: [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];

I've also found a raft of "suggested" ways of tackling it (including presenting modally instead of pushing, and pushing two inst开发者_开发技巧ances of the ViewController) Transitioning to landscape rotation within a uinavigationcontroller

However, I'm sure there must be an easier way to tackle this. If anyone knows of a way to PUSH onto the stack (to preserve navigation through the tree), in such a way that the viewcontroller appears landscape, please let me know.

Thanks for all your help guys,

dunc


It makes no sense to use a UINavigationController push transition to present a view in a different orientation. Which way round would the navigation bar / toolbar be?

Presenting a modal view controller is the right way to go about this. If this causes the status bar to become hidden, make sure yourModalViewController.wantsFullScreenLayout is NO.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜