<分区>
我正在开发一个纵向模式的应用程序。在我的一个 View Controller 中,当我单击 TableView 时,另一个以纵向模式打开的 View 。我希望它以横向模式打开。 请建议我如何做到这一点。 提前致谢!!
<分区>
我正在开发一个纵向模式的应用程序。在我的一个 View Controller 中,当我单击 TableView 时,另一个以纵向模式打开的 View 。我希望它以横向模式打开。 请建议我如何做到这一点。 提前致谢!!
最佳答案
据我所知,实现此目的的唯一方法是将 View Controller 显示为模式
[self presentModalViewController:landscapeViewController animated:YES];
并在
中指定横向模式-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationLandscapeLeft == interfaceOrientation;
}
这是因为如果模态视图只能以一个方向显示,应用程序会自动旋转到该方向。
有关更多详细信息,请参阅此问题的已接受答案:Transitioning to landscape rotation within a uinavigationcontroller
关于iphone - 以横向模式打开 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5755690/