tags:

views:

59

answers:

1

Hello,

I am working to force a view into landscape mode, and have picked up all kinds of cool tips to make this happen, but am stuck on one item that is left on the screen.

I have my XIB file laid out in landscape, and in my code I create the view controller normally:

RedeemViewController *aViewController = [[RedeemViewController alloc] initWithNibName:@"RedeemViewController" bundle:nil];
    aViewController.hidesBottomBarWhenPushed = YES;
    aViewController.wantsFullScreenLayout = YES;
[[self navigationController] pushViewController:aViewController animated:YES];  

Inside the controller viewDidLoad I complete the following:

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
[[self navigationController] setNavigationBarHidden:YES animated:YES];


[UIView beginAnimations:@"View Flip" context:nil];
[UIView setAnimationDuration:.75];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];

if (self.interfaceOrientation == UIInterfaceOrientationPortrait) {      
self.view.transform = CGAffineTransformIdentity;
self.view.transform = CGAffineTransformMakeRotation(degreesToRadian(90));
self.view.bounds = CGRectMake(0.0, 0.0, 480, 320);
}
[UIView commitAnimations];

What I end up with is a perfectly rotated view, with a grey vertical bar on the left side (see pic). alt text

So to the question, how do I get rid of the bar?

Edit: I am pretty sure this is the navigation bar that is not being hidden.

+3  A: 

Your bounds rectangle is created with the origin at (0, -20). Change that to (0, 0) and you should be rid of the offset and have the view filling the screen.

Giao
Oh, my bad, I was debugging a bit to see if I can move the image over. I get the same result at 0.0, and changing it to -20.0 moves the image down a bit, but not left or right. This was an attempt to move the view down under the status bar, otherwise, the status bar covers the top of the view. I have taken the -20 out of the above.
Rob Bonner