开发者

Leftover Nav Bar in Landscape View

开发者 https://www.devze.com 2022-12-19 04:00 出处:网络
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 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 开发者_如何学Gogrey vertical bar on the left side (see pic). alt text http://taxhelp.net/vert_bar.png

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.

This is a duplicate of another post, with some modified code, the other question was being answered with the bug.


Remove the navigation bar from Interface Builder or see if its being left behind by one of your other controllers.

I lost a few days on a similar problem because I didn't realize that one of my navbars was not being removed when another controller with a nav bar was being pushed onto another controller with a navbar. ;)

0

精彩评论

暂无评论...
验证码 换一张
取 消