iphone pushviewcontroller到景观

时间:2010-05-19 04:40:08

标签: iphone landscape pushviewcontroller

我有简单的iphone应用程序。它有3个视图。第一个视图是具有3个按钮的纵向视图。第二个视图有一个表视图,也是一个肖像。在第一个视图中,单击按钮时会显示第二个视图。在第二个视图中单击一个单元格时,将显示第三个视图。但第三种观点是一种景观。 我正在使用“pushViewController”从每个视图导航。 在IB中创建视图时,前两个视图是portait,第三个视图是横向视图。在第三个viewcontroller中,我也使用以下代码:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape(interfaceOrientation);
return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft));

}

如何在纵向和第三个视图中显示前两个视图。

2 个答案:

答案 0 :(得分:0)

尝试将其放入viewDidLoad

[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:YES];

答案 1 :(得分:0)

this thread中有相关问题的链接集合。特别是,请查看pix0r here的答案。