美文网首页
关于WRNavigationBar iOS12、iOS13导航栏

关于WRNavigationBar iOS12、iOS13导航栏

作者: dev_iCode | 来源:发表于2019-10-25 13:57 被阅读0次

    集成WRNavigationBar 适配iOS12 iOS13导航栏问题

    在修复iOS13下在iPhone11机型 iPhone11Pro iPhone11Pro Max上显示问题,附上已修改好的代码:

    + (BOOL)isIphoneX {

    struct utsname systemInfo;

    uname(&systemInfo);

    NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding];

    if ([platform isEqualToString:@"i386"] || [platform isEqualToString:@"x86_64"]) {

    // judgment by height when in simulators

    return ((CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(375, 812)) ||

    CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(812, 375))) || CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(414, 896)) ||

    CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(896, 414)));

    }

    BOOL isIPhoneX = [platform isEqualToString:@"iPhone10,3"] || [platform isEqualToString:@"iPhone10,6"] || [platform isEqualToString:@"iPhone11,2"] || [platform isEqualToString:@"iPhone11,4"] || [platform isEqualToString:@"iPhone11,6"] || [platform isEqualToString:@"iPhone11,8"] || [platform isEqualToString:@"iPhone12,1"] || [platform isEqualToString:@"iPhone12,3"] || [platform isEqualToString:@"iPhone12,5"];return isIPhoneX;

    }

    替换就可以了

    欢迎提出问题,我会继续更新

    相关文章

      网友评论

          本文标题:关于WRNavigationBar iOS12、iOS13导航栏

          本文链接:https://www.haomeiwen.com/subject/dhfjhxtx.html