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

关于WRNavigationBar iOS12、iOS13导航栏

作者: 天天都被占 | 来源:发表于2020-06-01 13:05 被阅读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;

}

@dev_iCode大佬文档

相关文章

网友评论

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

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