/**
根据当前屏幕获取字体大小
*/
+ (NSInteger)zxs_currentFontSize {
NSString *sizeString = NSStringFromCGSize([UIScreen mainScreen].bounds.size);
if ([sizeString isEqualToString:@"{320, 480}"]) {//iPhone4S 3.5英寸
return 12;
} else if ([sizeString isEqualToString:@"{320, 568}"]) {//iPhone 5、iphone5s、iphone5c、iphoneSE 4英寸
return 14;
} else if ([sizeString isEqualToString:@"{375, 667}"]) {//iphone6、iphone6s、iphone7、iPhone 8 4.7英寸
return 15;
} else if ([sizeString isEqualToString:@"{540, 960}"]) {//iphone6 plus、iphone6s plus、iphone7 plus、iphone8 plus 5.5英寸
return 17;
} else if ([sizeString isEqualToString:@"{562.5, 1218}"]) {//iPhone X 5.8 英寸
return 18;
}
return 17;
}
/**
根据当前屏幕获取字体
*/
+ (UIFont *)zxs_currentFont {
return [UIFont systemFontOfSize:[UIFont zxs_currentFontSize]];
}
网友评论