更新时间:2023-12-01 10:53:16
您使用 presentModalViewController
或 pushViewController
呈现的视图控制器应该支持任何方向,使用此方法:
The view's controller that you present either using presentModalViewController
OR pushViewController
should support any orientation, using this method:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
使用这种方法,当您以横向显示控制器时,也以横向方向显示。
With this method, when you present your controller in landscape orientation, it will correctly appear in landscape orientation, too.