2011-04-22 111 views
3

我正在纵向模式下开发一个应用程序。在我的一个视图控制器中,当我单击表格视图时,以纵向模式打开另一个视图。我希望​​它以横向模式打开。 请告诉我如何做到这一点。 在此先感谢!在横向模式下打开视图

+0

你已经解决您的问题或没有???? – SJS 2011-04-22 13:23:32

回答

0

我想that'l做:

[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight]; 

林不知道,但...

1

据我所知,实现这一目标的唯一途径是与

[self presentModalViewController:landscapeViewController animated:YES]; 

显示视图控制器为模式,并指定景观模式

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    return UIInterfaceOrientationLandscapeLeft == interfaceOrientation; 
} 

这是因为如果模态视图只能出现在一个方向上,应用程序会自动旋转到该方向。

见这个问题的答案接受了更多的细节:Transitioning to landscape rotation within a uinavigationcontroller

相关问题