权限记录

1.在我们项目中需要用的横屏的时候

步骤一:在UIApplication实现该方法

- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {

    if(self.isFull){

        return UIInterfaceOrientationMaskAll;

    }

    return UIInterfaceOrientationMaskPortrait;

}

步骤二: 在需要支持横屏的页面重写次方法

// 支持设备自动旋转- (BOOL)shouldAutorotate {

    return YES;

}// 支持横竖屏显示-(UIInterfaceOrientationMask)supportedInterfaceOrientations{

    return UIInterfaceOrientationMaskAll;

}

整个项目依然不支持横屏,对视图进行强制transform 旋转

不支持自动旋转监听屏幕是否旋转,需要使用UIDeviceOrientationDidChangeNotification的通知,判断方向在transform 相应的角度即可

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容