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


发布了201 篇原创文章 · 获赞 220 · 访问量 19万+

猜你喜欢

转载自blog.csdn.net/xjh093/article/details/95365725
今日推荐