ios如何让启动页(闪屏页)强制竖屏,而进入App后允许横屏和竖屏

1、修改App-info.plist(在XCode中General中设置 一样的效果)

UISupportedInterfaceOrientations

    UIInterfaceOrientationPortrait

2、AppDelegate中:

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
  return UIInterfaceOrientationMaskAllButUpsideDown;
}

参考:https://www.coder4.com/archives/5406

你可能感兴趣的:(ios如何让启动页(闪屏页)强制竖屏,而进入App后允许横屏和竖屏)