iphone pushviewcontroller风景

问题描述:

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

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

}

我怎么能显示纵向和横向第三个视图前两个视图。

尝试把这个在viewDidLoad中

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

我也这么做了。 – Satyam 2010-05-24 08:32:29

+1

正确的值是UIInterfaceOrientationLandscapeLeft – Mones 2013-05-29 14:29:23

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