启动应用程序并保持横向模式

如何在横向模式下启动我的应用程序,并保持屏幕旋转?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight); } 

实现视图控制器的shouldAutorotateToInterfaceOrientation:方法并return UIInterfaceOrientationIsLandscape(orientation);

UISupportedInterfaceOrientations Info.plistUISupportedInterfaceOrientationsUISupportedInterfaceOrientations设置为UISupportedInterfaceOrientationsUISupportedInterfaceOrientationsUIInterfaceOrientation将采用单个值,因此分配其中一个并将它们分配给UISupportedInterfaceOrientations