我的应用程序中有一个 View Controller 。让它的第一个 View Controller ,我的第一个 View Controller 在手机中以纵向模式出现,当用户以横向模式旋转手机时,第一个 View Controller 也以横向模式旋转。
它工作正常,现在我在第一个 View Controller 上有一个按钮,当我触摸该按钮时,第二个 View Controller 出现。我只想做的是第二个 View Controller 应该始终以纵向模式出现,即使第一个 View Controller 处于横向模式。 是否有任何我必须重写才能获得此功能的方法?
最佳答案
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
在第二个 View Controller 中保留这个。
关于iphone - 查看 Controller : Ladnscape to Portrait,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14193916/