在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 );
}
本文详细介绍了如何在RootViewController.mm文件中修改iOS应用的横竖屏显示方式,包括如何实现不同屏幕方向的适配。

1466

被折叠的 条评论
为什么被折叠?



