【发布时间】:2011-09-27 21:25:55
【问题描述】:
我有一个导航控制器,它以纵向方式通过它。然后,在某个时刻,我推送到一个显示图表的视图,我只想以横向显示,甚至根本不以纵向显示(这搞砸了视图的外观)。
在这个视图中,GraphViewController,我有如下方法:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
当视图第一次被推送时,它以纵向模式显示。如果我旋转手机,视图也会旋转成横向(而不是倒置纵向)。但我希望它永远不要处于纵向模式,即使它开始时也不行。我已经通过添加 NSLog 验证了此方法正在被调用。
【问题讨论】:
-
你设法让它工作了吗?
标签: iphone objective-c uinavigationcontroller autorotate