wangrui460/WRNavigationBar

iPhone XR和iPhone XS Max导航栏高度异常

MrCaiWH opened this issue · 2 comments

image
通过pod集成该库,就会导致这种情况发生

改下 [WRNavigationBar isIphoneX]判断就好了,比如

  • (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"];
    return isIPhoneX;
    }

@LwqDeveloper OK,感谢