在RootViewController.mm文件中,进行修改
1:默认横屏
// Override to allow orientations other than the default landscape orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
// switch to this line if you want to set portrait view
// return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}
2:竖屏
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsPortrait( interfaceOrientation );
// switch to this line if you want to set portrait view
// return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}
1:默认横屏
// Override to allow orientations other than the default landscape orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
// switch to this line if you want to set portrait view
// return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}
2:竖屏
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return UIInterfaceOrientationIsPortrait( interfaceOrientation );
// switch to this line if you want to set portrait view
// return UIInterfaceOrientationIsPortrait( interfaceOrientation );
}