iOS 设置横屏导致崩溃!

0x00

*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'preferredInterfaceOrientationForPresentation 'landscapeLeft' must match a supported interface orientation: 'portrait, landscapeRight'!'


0x01

所支持的方向是一个集合
当前设备方向
应该是集合中的一个值

/// 当前方向
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    if (hengping) {
        return UIInterfaceOrientationLandscapeRight;
    }else{
        return UIInterfaceOrientationPortrait;
    }
}

/// 所支持的方向
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight;
}

画线,画虚线,画五角星,画矩形,画虚线矩形,渐变色

https://github.com/xjh093/JHDraw


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

推荐阅读更多精彩内容