I think the title is pretty descriptive:
I perform all 3 of these operations on a view, the result is 20 pixels of white space along the left side of the screen (if
I think you may need to recenter your center:
// Set the center point of the view to the center point of the window's content area.
self.view.center = CGPointMake(160.0, 240.0);
This is the whole init method I use for landscape views and works without an issue. Just make sure to set your nib to the right size too.
// Implement viewDidLoad to do additional setup after loading the view.
- (void)viewDidLoad {
[super viewDidLoad];
// Rotate to landscape
self.view.frame = CGRectMake(0, 0, 480.0, 320.0);
if ([[UIApplication sharedApplication] statusBarOrientation] == UIInterfaceOrientationLandscapeRight) {
CGAffineTransform transform = self.view.transform;
// Set the center point of the view to the center point of the window's content area.
self.view.center = CGPointMake(160.0, 240.0);
// Rotate the view 90 degrees around its new center point.
transform = CGAffineTransformRotate(transform, (M_PI / 2.0));
self.view.transform = transform;
}
}