我的应用程序中有两个 View 。一个(默认情况下)是横向。当用户单击某个菜单时,我需要显示纵向 View 。
我已准备好所有代码,我正在尝试使用它:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
但应用程序仍以横向显示下一个 View 。我想不通。任何帮助都会很棒。
最佳答案
You can not do it using navigation controller but if you are presenting your view then it is possible to do that and make sure when you are presenting your view animation should be NO.
It works for me very well.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
关于iphone - 在 iOS 上从横向 View 切换到纵向 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12907606/