在横向模式下打开视图
问题描述:
我正在纵向模式下开发一个应用程序。在我的一个视图控制器中,当我单击表格视图时,以纵向模式打开另一个视图。我希望它以横向模式打开。 请告诉我如何做到这一点。 在此先感谢!在横向模式下打开视图
答
我想that'l做:
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight];
林不知道,但...
答
我敢肯定你不能使用setOrientation
了,因为它已被废弃,应用程序已被拒绝使用它。
这可能是一个选项,供您:
http://www.iphonedevsdk.com/forum/iphone-sdk-development/33548-alternative-setorientation.html
它旋转使用转换的观点。
感谢名单.....
答
据我所知,实现这一目标的唯一途径是与
[self presentModalViewController:landscapeViewController animated:YES];
显示视图控制器为模式,并指定景观模式
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationLandscapeLeft == interfaceOrientation;
}
这是因为如果模态视图只能出现在一个方向上,应用程序会自动旋转到该方向。
见这个问题的答案接受了更多的细节:Transitioning to landscape rotation within a uinavigationcontroller
你已经解决您的问题或没有???? – SJS 2011-04-22 13:23:32