在 AppDelegate 设置屏幕切换

1 //禁止横屏显示
2 - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
3 {
4     return UIInterfaceOrientationMaskPortrait;
5 }
原文地址:https://www.cnblogs.com/wangshengl9263/p/3291224.html