第46月第23天 iOS强制横屏

1.

在AppDelegate.m中添加转屏的代理方法

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(nullable UIWindow *)window
{
    if (self.allowRotation == YES) {
        //横屏
        return UIInterfaceOrientationMaskLandscape;
    }else{
        //竖屏
        return UIInterfaceOrientationMaskPortrait;
    }
}

http://www.cocoachina.com/articles/899237?filter=ios

原文地址:https://www.cnblogs.com/javastart/p/13364824.html