第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

posted @ 2020-07-23 10:25  lianhuaren  阅读(110)  评论(0编辑  收藏  举报