I would like to display a different controller when the iPhone is rotated. But only on it is on a 开发者_高级运维certain controller. This is very similar to what the Bloomberg app does when you are looking at a stock. Turn the device and a 3 month's chart shows up.
If there are some examples of this posted, that would be great to look at. If someone could post where they are.
thx, wes
Here's Apple's AlternateViews sample project that does exactly what you're talking about.
I'd first read through Apple's documentation on how to handle orientation changes. It's relatively straight forward - in your view which responds to the orientation changes, you'll want to implement -shouldAutorotateToInterfaceOrientation:
and some combination of -willRotateToInterfaceOrientation:duration:
and -didRotateToInterfaceOrientation:duration:
.
If you want separate view controllers for each orientation, I would use a "parent" view controller that responds to orientation changes and contains the logic to switch out views and view controllers based on its orientation.
精彩评论