views:

243

answers:

2

I'm using a NavigationController and have a particular View that does not lay out well when switched to Landscape mode. I've made a "landscape optimized" version of that view and when the user rotates the iPhone, I'd like to switch from the Portait version to the Landscape version. The reason is I have 0 - 9 in classic calculator 3 x 3 + 1 format which gets hidden.

I thought I might be able to do this with the WillRotate and pop the current view off the NavigationController stack and push the replacement on, but that's throwing an exception.

Any ideas? I'd like it to be animated and if possible make this not seem obvious to the user.

+3  A: 

I blogged about it here: http://escoz.com/displaying-different-views-when-iphone-is-rotated-with-monotouch/

It explains how the phone see's the rotation event as well as how to switch views. Hope its helpful. The code is in github, like Rob pointed above: http://github.com/escoz/monotouch-controls/blob/master/UICatalog/RotatingViewController.cs

It currently doesn't do any additional animations (other than the "rotating" effect), but it shouldn't be too hard to implement that. Feel free to contribute on github if you do that!

Eduardo Scoz