封装KBFont,适配字体

This commit is contained in:
2025-11-25 15:36:16 +08:00
parent 71423df1c0
commit 1eb73f5257
40 changed files with 224 additions and 101 deletions

View File

@@ -154,6 +154,7 @@
KBTopImageButton *btn = self.featureButtons[i];
if (i < count) {
btn.textLabel.text = titles[i];
btn.textLabel.font = [KBFont regular:12];
}
UIImage *img = (i < images.count) ? images[i] : nil;
btn.iconView.image = img;
@@ -188,7 +189,8 @@
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
// _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
_titleLabel.font = [KBFont bold:18];
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
@@ -198,7 +200,8 @@
- (UILabel *)subTitleLabel {
if (!_subTitleLabel) {
_subTitleLabel = [[UILabel alloc] init];
_subTitleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
// _subTitleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightRegular];
_subTitleLabel.font = [KBFont regular:14];
_subTitleLabel.textColor = self.titleLabel.textColor;
_subTitleLabel.textAlignment = NSTextAlignmentCenter;
}
@@ -236,7 +239,8 @@
_buyButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_buyButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal];
[_buyButton setTitleColor:[UIColor colorWithHex:0x1B1F1A] forState:UIControlStateNormal];
_buyButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
// _buyButton.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
_buyButton.titleLabel.font = [KBFont medium:15];
[_buyButton setBackgroundImage:[UIImage imageNamed:@"recharge_now_icon"] forState:UIControlStateNormal];
[_buyButton addTarget:self action:@selector(onTapBuyAction) forControlEvents:UIControlEventTouchUpInside];
}