【发布时间】:2011-01-12 07:58:22
【问题描述】:
我正在努力将视图强制为横向模式,并且已经掌握了各种很酷的技巧来实现这一点,但我卡在了留在屏幕上的一个项目上。
我的 XIB 文件以横向布局,在我的代码中我通常创建视图控制器:
RedeemViewController *aViewController = [[RedeemViewController alloc] initWithNibName:@"RedeemViewController" bundle:nil];
aViewController.hidesBottomBarWhenPushed = YES;
aViewController.wantsFullScreenLayout = YES;
[[self navigationController] pushViewController:aViewController animated:YES];
在控制器 viewDidLoad 中,我完成了以下操作:
[[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];
我最终得到的是一个完美旋转的视图,左侧有一个灰色的垂直条(见图)。 alt text http://taxhelp.net/vert_bar.png
那么问题来了,我该如何摆脱酒吧?
编辑:我很确定这是没有被隐藏的导航栏。
【问题讨论】:
标签: iphone