In a view-based iPhone OS application, I change the orientation from the initial portrait orientation to a landscape orientation (UIInterfaceOrientationLand
If you do the recommended approach of applying a transform to your main view in order to rotate it:
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationLandscapeRight)
{
CGAffineTransform transform = primaryView.transform;
// Use the status bar frame to determine the center point of the window's content area.
CGRect statusBarFrame = [[UIApplication sharedApplication] statusBarFrame];
CGRect bounds = CGRectMake(0, 0, statusBarFrame.size.height, statusBarFrame.origin.x);
CGPoint center = CGPointMake(60.0, bounds.size.height / 2.0);
// Set the center point of the view to the center point of the window's content area.
primaryView.center = center;
// Rotate the view 90 degrees around its new center point.
transform = CGAffineTransformRotate(transform, (M_PI / 2.0));
primaryView.transform = transform;
}
then any subviews you add to this main view should use the standard coordinate system. The transform that is applied to the main view takes care of rotating the coordinates of the subviews, as well. This works well for me in my application.