设置横屏与竖屏的方法
找到RootViewController.m这个文件,打开
找到这个方法
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // return YES for the supported orientations// Only landscape 仅支持横向// return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );// Only portrait 仅支持竖向// return ( ! UIInterfaceOrientationIsLandscape( interfaceOrientation ) );// All orientations 既支持竖向又支持横向// return YES;}