How to do orientation rotation like built-in Calc app?

Posted by Ray Wenderlich on Stack Overflow See other posts from Stack Overflow or by Ray Wenderlich
Published on 2010-05-06T13:15:27Z Indexed on 2010/05/06 13:18 UTC
Read the original article Hit count: 165

Filed under:
|

I'm trying to make an app that handles orientation/rotation similarly to the way the built-in Calc app does.

If you check out that app, in portrait mode there's a normal calculator, and if you rotate to landscape mode there are additional buttons that appear to the left.

I can't figure out how to do this by setting the autosize masks. The problem is the "normal" calculator view is 320px wide in portrait mode, but actually shrinks to around 240px in landscape mode to fit the additional controls.

I've seen examples like the AlternateViews sample app that have two different view controllers (one for portrait and one for landscape), but they don't seem to animate the transitions between the views nicely like the Calc app does.

I've also tried setting the frames for the views manually in willAnimateSecondHalfOfRotationFromInterfaceOrientation, but it doesn't seem to look "quite right" and also I'm not certain how that works with the autoresize mask.

Any ideas how this is done? Thanks!

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about iphone