封装KBFont,适配字体
This commit is contained in:
@@ -33,6 +33,9 @@
|
||||
#define KB_BASE_URL @"http://192.168.1.144:7529/api"
|
||||
#endif
|
||||
|
||||
#import "KBFont.h"
|
||||
|
||||
|
||||
// Universal Links 通用链接
|
||||
#ifndef KB_UL_BASE
|
||||
#define KB_UL_BASE @"https://app.tknb.net/ul"
|
||||
|
||||
45
Shared/KBFont.h
Normal file
45
Shared/KBFont.h
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// KBFont.h
|
||||
// 全局字体工具(主 App 与键盘扩展共用)
|
||||
//
|
||||
// 说明:
|
||||
// - 不做系统 Dynamic Type 适配,字号只按设计稿 + 屏幕宽度等比缩放
|
||||
// - 统一从这里取字体,避免在各处到处写死数字和 weight
|
||||
//
|
||||
|
||||
#ifndef KBFont_h
|
||||
#define KBFont_h
|
||||
|
||||
#if __OBJC__
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "KBConfig.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface KBFont : NSObject
|
||||
|
||||
/// 按设计稿字号 + 屏幕宽度缩放,返回系统字体
|
||||
/// 使用示例:label.font = [KBFont fontOfSize:14 weight:UIFontWeightRegular];
|
||||
+ (UIFont *)fontOfSize:(CGFloat)designSize weight:(UIFontWeight)weight;
|
||||
|
||||
/// 常用 weight 封装(设计稿字号)
|
||||
+ (UIFont *)regular:(CGFloat)designSize;
|
||||
+ (UIFont *)medium:(CGFloat)designSize;
|
||||
+ (UIFont *)semibold:(CGFloat)designSize;
|
||||
+ (UIFont *)bold:(CGFloat)designSize;
|
||||
|
||||
/// 根据当前项目大致预设的几个常用语义字号
|
||||
/// 可以按设计调整里面的数值,不影响调用方
|
||||
+ (UIFont *)titleFont; // 标题,例如 18pt 半粗
|
||||
+ (UIFont *)bodyFont; // 正文,例如 14pt 常规
|
||||
+ (UIFont *)captionFont; // 辅助/备注,例如 12pt 常规
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
#endif /* __OBJC__ */
|
||||
|
||||
#endif /* KBFont_h */
|
||||
|
||||
53
Shared/KBFont.m
Normal file
53
Shared/KBFont.m
Normal file
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// KBFont.m
|
||||
//
|
||||
|
||||
#import "KBFont.h"
|
||||
|
||||
#if __OBJC__
|
||||
|
||||
@implementation KBFont
|
||||
|
||||
+ (UIFont *)fontOfSize:(CGFloat)designSize weight:(UIFontWeight)weight {
|
||||
// 以 375 设计稿为基准等比缩放(见 KBConfig.h 中的 KBFit)
|
||||
CGFloat scaledSize = KBFit(designSize);
|
||||
return [UIFont systemFontOfSize:scaledSize weight:weight];
|
||||
}
|
||||
|
||||
+ (UIFont *)regular:(CGFloat)designSize {
|
||||
return [self fontOfSize:designSize weight:UIFontWeightRegular];
|
||||
}
|
||||
|
||||
+ (UIFont *)medium:(CGFloat)designSize {
|
||||
return [self fontOfSize:designSize weight:UIFontWeightMedium];
|
||||
}
|
||||
|
||||
+ (UIFont *)semibold:(CGFloat)designSize {
|
||||
return [self fontOfSize:designSize weight:UIFontWeightSemibold];
|
||||
}
|
||||
|
||||
+ (UIFont *)bold:(CGFloat)designSize {
|
||||
return [self fontOfSize:designSize weight:UIFontWeightBold];
|
||||
}
|
||||
|
||||
#pragma mark - 语义字体(可按设计自由修改数值)
|
||||
|
||||
+ (UIFont *)titleFont {
|
||||
// 例如:18pt,半粗体
|
||||
return [self fontOfSize:18.0 weight:UIFontWeightSemibold];
|
||||
}
|
||||
|
||||
+ (UIFont *)bodyFont {
|
||||
// 例如:14pt,常规
|
||||
return [self regular:14.0];
|
||||
}
|
||||
|
||||
+ (UIFont *)captionFont {
|
||||
// 例如:12pt,常规
|
||||
return [self regular:12.0];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
|
||||
// Mine
|
||||
"Settings" = "Settings";
|
||||
"Personal" = "Personal";
|
||||
"My Keyboard" = "My Keyboard";
|
||||
"Notice" = "Notice";
|
||||
"Share App" = "Share App";
|
||||
@@ -159,6 +160,8 @@
|
||||
"Payment failed" = "Payment failed";
|
||||
"Purchase: %@ Coins %@" = "Purchase: %@ Coins %@";
|
||||
"Pay clicked" = "Pay clicked";
|
||||
"Points Recharge" = "Points Recharge";
|
||||
"My Points" = "My Points";
|
||||
|
||||
// Example categories/items
|
||||
"能力" = "Ability";
|
||||
|
||||
@@ -89,10 +89,11 @@
|
||||
"Rank" = "排行";
|
||||
"Recharge Now" = "立即充值";
|
||||
"By clicking Pay, you indicate your agreement to the" = "点击“支付”即表示您同意";
|
||||
"《Embership Agreement》" = "会员协议";
|
||||
"《Embership Agreement》" = "《会员协议》";
|
||||
|
||||
// Mine
|
||||
"Settings" = "设置";
|
||||
"Personal" = "个人";
|
||||
"My Keyboard" = "我的键盘";
|
||||
"Notice" = "通知";
|
||||
"Share App" = "分享app";
|
||||
@@ -156,7 +157,9 @@
|
||||
"Payment successful" = "支付成功";
|
||||
"Payment failed" = "支付失败";
|
||||
"Purchase: %@ Coins %@" = "购买:%@ Coins %@";
|
||||
"Pay clicked" = "Pay clicked";
|
||||
"Pay clicked" = "点击支付";
|
||||
"Points Recharge" = "积分充值";
|
||||
"My Points" = "我的积分";
|
||||
|
||||
// 示例商品/分类
|
||||
"能力" = "能力";
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
04791F8F2ED469C0004E8522 /* KBHostAppLauncher.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F8D2ED469C0004E8522 /* KBHostAppLauncher.m */; };
|
||||
04791F922ED48010004E8522 /* KBNoticeVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F912ED48010004E8522 /* KBNoticeVC.m */; };
|
||||
04791F952ED48028004E8522 /* KBFeedBackVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F942ED48028004E8522 /* KBFeedBackVC.m */; };
|
||||
04791F982ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
|
||||
04791F992ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
|
||||
047C650D2EBC8A840035E841 /* KBPanModalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650C2EBC8A840035E841 /* KBPanModalView.m */; };
|
||||
047C65102EBCA8DD0035E841 /* HomeRankContentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650F2EBCA8DD0035E841 /* HomeRankContentVC.m */; };
|
||||
047C65502EBCBA9E0035E841 /* KBShopVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C654F2EBCBA9E0035E841 /* KBShopVC.m */; };
|
||||
@@ -258,6 +260,8 @@
|
||||
04791F912ED48010004E8522 /* KBNoticeVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBNoticeVC.m; sourceTree = "<group>"; };
|
||||
04791F932ED48028004E8522 /* KBFeedBackVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFeedBackVC.h; sourceTree = "<group>"; };
|
||||
04791F942ED48028004E8522 /* KBFeedBackVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFeedBackVC.m; sourceTree = "<group>"; };
|
||||
04791F962ED49CE7004E8522 /* KBFont.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFont.h; sourceTree = "<group>"; };
|
||||
04791F972ED49CE7004E8522 /* KBFont.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFont.m; sourceTree = "<group>"; };
|
||||
047C650B2EBC8A840035E841 /* KBPanModalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBPanModalView.h; sourceTree = "<group>"; };
|
||||
047C650C2EBC8A840035E841 /* KBPanModalView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBPanModalView.m; sourceTree = "<group>"; };
|
||||
047C650E2EBCA8DD0035E841 /* HomeRankContentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeRankContentVC.h; sourceTree = "<group>"; };
|
||||
@@ -1273,6 +1277,8 @@
|
||||
04A9FE1F2EB893F10020DB6D /* Localization */,
|
||||
04FC98012EB36AAB007BD342 /* KBConfig.h */,
|
||||
04122F592EC5D40000EF7AB3 /* KBAPI.h */,
|
||||
04791F962ED49CE7004E8522 /* KBFont.h */,
|
||||
04791F972ED49CE7004E8522 /* KBFont.m */,
|
||||
A1B2C4002EB4A0A100000001 /* KBAuthManager.h */,
|
||||
A1B2C4002EB4A0A100000002 /* KBAuthManager.m */,
|
||||
A1B2C4232EB4B7A100000001 /* KBKeyboardPermissionManager.h */,
|
||||
@@ -1557,6 +1563,7 @@
|
||||
049FB22F2EC34EB900FAB05D /* KBStreamTextView.m in Sources */,
|
||||
04FC95702EB09516007BD342 /* KBFunctionView.m in Sources */,
|
||||
049FB23F2EC4B6EF00FAB05D /* KBULBridgeNotification.m in Sources */,
|
||||
04791F992ED49CE7004E8522 /* KBFont.m in Sources */,
|
||||
04FC956D2EB054B7007BD342 /* KBKeyboardView.m in Sources */,
|
||||
04FC95672EB0546C007BD342 /* KBKey.m in Sources */,
|
||||
A1B2C3F42EB35A9900000001 /* KBFullAccessGuideView.m in Sources */,
|
||||
@@ -1630,6 +1637,7 @@
|
||||
0477BDF02EBB76E30055D639 /* HomeSheetVC.m in Sources */,
|
||||
048908E62EBF841B00FABA60 /* KBSkinDetailTagCell.m in Sources */,
|
||||
04FC97002EB30A00007BD342 /* KBGuideTopCell.m in Sources */,
|
||||
04791F982ED49CE7004E8522 /* KBFont.m in Sources */,
|
||||
0477BDFA2EBC66340055D639 /* HomeHeadView.m in Sources */,
|
||||
04FC97032EB30A00007BD342 /* KBGuideKFCell.m in Sources */,
|
||||
04FC97062EB30A00007BD342 /* KBGuideUserCell.m in Sources */,
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
if (!_contentLabel) {
|
||||
_contentLabel = [UILabel new];
|
||||
_contentLabel.numberOfLines = 0;
|
||||
_contentLabel.font = [UIFont systemFontOfSize:15];
|
||||
_contentLabel.font = [KBFont regular:15];
|
||||
_contentLabel.textColor = [UIColor colorWithWhite:0.15 alpha:1.0];
|
||||
}
|
||||
return _contentLabel;
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
if (!_contentLabel) {
|
||||
_contentLabel = [UILabel new];
|
||||
_contentLabel.numberOfLines = 0;
|
||||
_contentLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_contentLabel.font = [KBFont medium:16];
|
||||
_contentLabel.textColor = [UIColor whiteColor];
|
||||
_contentLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.text = @"Please Select Your Gender";
|
||||
_titleLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:20];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.numberOfLines = 1;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) {
|
||||
_skipButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_skipButton setTitle:@"Skip" forState:UIControlStateNormal];
|
||||
[_skipButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal];
|
||||
_skipButton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
_skipButton.titleLabel.font = [KBFont medium:12];
|
||||
_skipButton.backgroundColor = [UIColor colorWithHex:0xE9F7F4];
|
||||
_skipButton.layer.cornerRadius = 16;
|
||||
_skipButton.layer.masksToBounds = YES;
|
||||
@@ -338,7 +338,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) {
|
||||
if (!_maleLabel) {
|
||||
_maleLabel = [UILabel new];
|
||||
_maleLabel.text = @"Male";
|
||||
_maleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
_maleLabel.font = [KBFont medium:20];
|
||||
_maleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _maleLabel;
|
||||
@@ -366,7 +366,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) {
|
||||
if (!_femaleLabel) {
|
||||
_femaleLabel = [UILabel new];
|
||||
_femaleLabel.text = @"Female";
|
||||
_femaleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
_femaleLabel.font = [KBFont medium:20];
|
||||
_femaleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _femaleLabel;
|
||||
@@ -402,7 +402,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) {
|
||||
if (!_otherLabel) {
|
||||
_otherLabel = [UILabel new];
|
||||
_otherLabel.text = @"The Third Gender";
|
||||
_otherLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
|
||||
_otherLabel.font = [KBFont medium:20];
|
||||
_otherLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _otherLabel;
|
||||
@@ -413,7 +413,7 @@ typedef NS_ENUM(NSInteger, KBSexOption) {
|
||||
_confirmButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_confirmButton setTitle:@"Turn On The Keyboard" forState:UIControlStateNormal];
|
||||
[_confirmButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_confirmButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_confirmButton.titleLabel.font = [KBFont bold:16];
|
||||
_confirmButton.backgroundColor = [UIColor blackColor];
|
||||
_confirmButton.layer.cornerRadius = 30;
|
||||
_confirmButton.layer.masksToBounds = YES;
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
@@ -130,7 +130,7 @@
|
||||
- (UILabel *)subLabel {
|
||||
if (!_subLabel) {
|
||||
_subLabel = [[UILabel alloc] init];
|
||||
_subLabel.font = [UIFont systemFontOfSize:12];
|
||||
_subLabel.font = [KBFont regular:12];
|
||||
_subLabel.textColor = [UIColor colorWithHex:0x9A9A9A];
|
||||
_subLabel.numberOfLines = 2;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
@@ -169,7 +169,7 @@
|
||||
if (!_descLabel) {
|
||||
_descLabel = [UILabel new];
|
||||
_descLabel.textColor = [UIColor colorWithHex:0x9A9A9A];
|
||||
_descLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
|
||||
_descLabel.font = [KBFont regular:12];
|
||||
_descLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_descLabel.numberOfLines = 2;
|
||||
}
|
||||
@@ -180,7 +180,7 @@
|
||||
if (!_peopleLabel) {
|
||||
_peopleLabel = [UILabel new];
|
||||
_peopleLabel.textColor = [UIColor colorWithHex:KBColorValue];
|
||||
_peopleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular];
|
||||
_peopleLabel.font = [KBFont regular:10];
|
||||
_peopleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_peopleLabel.numberOfLines = 2;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_titleLabel.text = @"High EQ"; // 默认文案
|
||||
}
|
||||
@@ -186,7 +186,7 @@
|
||||
_downloadLabel = [UILabel new];
|
||||
_downloadLabel.textColor = [UIColor colorWithHex:KBColorValue];
|
||||
_downloadLabel.backgroundColor = [UIColor colorWithHex:0xEDFFFD];
|
||||
_downloadLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightMedium];
|
||||
_downloadLabel.font = [KBFont regular:13];
|
||||
_downloadLabel.textAlignment = NSTextAlignmentCenter;
|
||||
_downloadLabel.text = @"Download: 1 Million";
|
||||
}
|
||||
@@ -207,7 +207,7 @@
|
||||
if (!_descLabel) {
|
||||
_descLabel = [UILabel new];
|
||||
_descLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_descLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
_descLabel.font = [KBFont medium:14];
|
||||
_descLabel.numberOfLines = 0;
|
||||
_descLabel.text = @"Be Neither Too Close\nNor Too Distant";
|
||||
}
|
||||
@@ -219,7 +219,7 @@
|
||||
_saveButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_saveButton setTitle:@"Save" forState:UIControlStateNormal];
|
||||
[_saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_saveButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_saveButton.titleLabel.font = [KBFont medium:16];
|
||||
_saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0];
|
||||
_saveButton.layer.cornerRadius = 24.0;
|
||||
_saveButton.layer.masksToBounds = YES;
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.textColor = [UIColor colorWithWhite:0.1 alpha:1];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:13];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.text = KBLocalized(@"Change The Nickname");
|
||||
_titleLabel.textColor = [UIColor blackColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightBold];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
@@ -159,7 +159,7 @@
|
||||
if (!_textField) {
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
_textField.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_textField.font = [KBFont medium:16];
|
||||
_textField.textColor = [UIColor blackColor];
|
||||
_textField.placeholder = KBLocalized(@"Please Enter The Modified Nickname");
|
||||
}
|
||||
@@ -171,8 +171,8 @@
|
||||
_saveButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_saveButton setTitle:KBLocalized(@"Save") forState:UIControlStateNormal];
|
||||
[_saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_saveButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
_saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0];
|
||||
_saveButton.titleLabel.font = [KBFont medium:16];
|
||||
_saveButton.backgroundColor = [UIColor colorWithHex:KBColorValue];
|
||||
_saveButton.layer.cornerRadius = 28.0; _saveButton.layer.masksToBounds = YES; // 胶囊按钮
|
||||
[_saveButton addTarget:self action:@selector(onTapSave) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
if (![label isKindOfClass:UILabel.class]) {
|
||||
label = [[UILabel alloc] init];
|
||||
label.textAlignment = NSTextAlignmentCenter;
|
||||
label.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
label.font = [KBFont medium:16];
|
||||
}
|
||||
NSString *name = self.items[row][@"name"] ?: @"";
|
||||
label.text = name;
|
||||
@@ -178,7 +178,7 @@
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.text = @"Modify Gender";
|
||||
_titleLabel.textColor = [UIColor blackColor];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightBold];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
@@ -222,7 +222,7 @@
|
||||
_saveButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_saveButton setTitle:@"Save" forState:UIControlStateNormal];
|
||||
[_saveButton setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
|
||||
_saveButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
_saveButton.titleLabel.font = [KBFont medium:16];
|
||||
_saveButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0];
|
||||
_saveButton.layer.cornerRadius = 23.0; _saveButton.layer.masksToBounds = YES;
|
||||
[_saveButton addTarget:self action:@selector(onTapSave) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
@@ -107,8 +107,8 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.text = KBLocalized(@"Settings"); // 大标题
|
||||
_titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightBold];
|
||||
_titleLabel.text = KBLocalized(@"Personal"); // 大标题
|
||||
_titleLabel.font = [KBFont bold:30];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
@@ -118,7 +118,7 @@
|
||||
if (!_keyboardBtn) {
|
||||
_keyboardBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_keyboardBtn setTitle:KBLocalized(@"My Keyboard") forState:UIControlStateNormal];
|
||||
_keyboardBtn.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightSemibold];
|
||||
_keyboardBtn.titleLabel.font = [KBFont medium:10];
|
||||
[_keyboardBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_keyboardBtn.backgroundColor = [UIColor colorWithHex:KBColorValue];
|
||||
_keyboardBtn.layer.cornerRadius = 17;
|
||||
@@ -129,7 +129,7 @@
|
||||
if (kbImg) {
|
||||
[_keyboardBtn setImage:kbImg forState:UIControlStateNormal];
|
||||
_keyboardBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
CGFloat spacing = 6.0;
|
||||
CGFloat spacing = 3.0;
|
||||
_keyboardBtn.contentEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, spacing);
|
||||
_keyboardBtn.titleEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, -spacing);
|
||||
}
|
||||
@@ -156,8 +156,8 @@
|
||||
if (!_nameLabel) {
|
||||
_nameLabel = [UILabel new];
|
||||
_nameLabel.text = @"Notice";
|
||||
_nameLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
_nameLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
_nameLabel.font = [KBFont medium:20];
|
||||
_nameLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _nameLabel;
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
+ (CGSize)sizeForEmoji:(NSString *)emoji title:(NSString *)title {
|
||||
// 固定高度 44,宽度 = 左右内边距(12+12) + Emoji 宽(按 20 号字估算) + 间距(8) + 文案宽
|
||||
UIFont *emojiFont = [UIFont systemFontOfSize:20];
|
||||
UIFont *titleFont = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
UIFont *titleFont = [KBFont regular:13];
|
||||
|
||||
CGFloat emojiW = 0;
|
||||
if (emoji.length > 0) {
|
||||
@@ -128,7 +128,7 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont regular:13];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -98,8 +98,8 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x222222];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.text = @"Title";
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightRegular];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
@@ -158,7 +158,7 @@
|
||||
if (!_valueLabel) {
|
||||
_valueLabel = [UILabel new];
|
||||
_valueLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_valueLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_valueLabel.font = [KBFont bold:16];
|
||||
_valueLabel.textAlignment = NSTextAlignmentRight;
|
||||
[_valueLabel setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:16];
|
||||
_titleLabel.textColor = [UIColor whiteColor];
|
||||
_titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
@@ -143,7 +143,7 @@
|
||||
- (UILabel *)priceLabel {
|
||||
if (!_priceLabel) {
|
||||
_priceLabel = [[UILabel alloc] init];
|
||||
_priceLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightSemibold];
|
||||
_priceLabel.font = [KBFont medium:16];
|
||||
_priceLabel.textColor = [UIColor whiteColor];
|
||||
_priceLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@
|
||||
- (UILabel *)leftLabel {
|
||||
if (!_leftLabel) {
|
||||
_leftLabel = [UILabel new];
|
||||
_leftLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
_leftLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_leftLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_leftLabel.font = [KBFont medium:16];
|
||||
_leftLabel.text = @"Dopamine";
|
||||
}
|
||||
return _leftLabel;
|
||||
@@ -67,7 +67,7 @@
|
||||
if (!_rightLabel) {
|
||||
_rightLabel = [UILabel new];
|
||||
_rightLabel.textColor = [UIColor colorWithHex:KBColorValue];
|
||||
_rightLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
|
||||
_rightLabel.font = [KBFont regular:13];
|
||||
_rightLabel.textAlignment = NSTextAlignmentRight;
|
||||
_rightLabel.text = @"Download: 1 Million";
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:14];
|
||||
_titleLabel.text = @"Recommended Skin";
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -167,8 +167,8 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x333333];
|
||||
_titleLabel.font = [KBFont regular:14];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.text = @"Dopamine";
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
_textView = [[UITextView alloc] init];
|
||||
_textView.delegate = self;
|
||||
_textView.backgroundColor = [UIColor clearColor];
|
||||
_textView.font = [UIFont systemFontOfSize:16];
|
||||
_textView.font = [KBFont medium:14];
|
||||
_textView.textColor = [UIColor blackColor];
|
||||
_textView.textContainerInset = UIEdgeInsetsZero;
|
||||
_textView.textContainer.lineFragmentPadding = 0;
|
||||
@@ -129,7 +129,7 @@
|
||||
if (!_placeholderLabel) {
|
||||
_placeholderLabel = [UILabel new];
|
||||
_placeholderLabel.textColor = [UIColor colorWithWhite:0.75 alpha:1.0];
|
||||
_placeholderLabel.font = [UIFont systemFontOfSize:16];
|
||||
_placeholderLabel.font = [KBFont medium:14];
|
||||
_placeholderLabel.text = KBLocalized(@"Please Enter The Content");
|
||||
}
|
||||
return _placeholderLabel;
|
||||
@@ -138,8 +138,8 @@
|
||||
- (UILabel *)countLabel {
|
||||
if (!_countLabel) {
|
||||
_countLabel = [UILabel new];
|
||||
_countLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0];
|
||||
_countLabel.font = [UIFont systemFontOfSize:14];
|
||||
_countLabel.textColor = [UIColor colorWithHex:0xACACAC];
|
||||
_countLabel.font = [KBFont regular:13];
|
||||
_countLabel.textAlignment = NSTextAlignmentRight;
|
||||
_countLabel.text = @"0/100";
|
||||
}
|
||||
@@ -151,7 +151,7 @@
|
||||
_commitButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_commitButton setTitle:KBLocalized(@"Commit") forState:UIControlStateNormal];
|
||||
[_commitButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_commitButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
_commitButton.titleLabel.font = [KBFont medium:16];
|
||||
// 使用与修改昵称弹窗相近的主色
|
||||
_commitButton.backgroundColor = [UIColor colorWithRed:0.02 green:0.75 blue:0.67 alpha:1.0];
|
||||
_commitButton.layer.cornerRadius = 28.0;
|
||||
|
||||
@@ -261,7 +261,7 @@ static NSString * const kKBMyKeyboardCellId = @"kKBMyKeyboardCellId";
|
||||
if (!_saveButton) {
|
||||
_saveButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
[_saveButton setTitle:KBLocalized(@"Save") forState:UIControlStateNormal];
|
||||
_saveButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_saveButton.titleLabel.font = [KBFont medium:16];
|
||||
[_saveButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_saveButton.backgroundColor = [UIColor colorWithHex:KBColorValue];
|
||||
_saveButton.layer.cornerRadius = 25;
|
||||
|
||||
@@ -75,8 +75,8 @@
|
||||
- (UILabel *)noticeTitleLabel {
|
||||
if (!_noticeTitleLabel) {
|
||||
_noticeTitleLabel = [UILabel new];
|
||||
_noticeTitleLabel.textColor = [UIColor blackColor];
|
||||
_noticeTitleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_noticeTitleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_noticeTitleLabel.font = [KBFont medium:16];
|
||||
// 文案可根据需要在 Localizable.strings 中配置多语言
|
||||
_noticeTitleLabel.text = KBLocalized(@"Notification Setting");
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
_modifyLabel = [UILabel new];
|
||||
_modifyLabel.text = @"Modify";
|
||||
_modifyLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_modifyLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_modifyLabel.font = [KBFont bold:18];
|
||||
}
|
||||
return _modifyLabel;
|
||||
}
|
||||
@@ -281,9 +281,9 @@
|
||||
- (UIButton *)logoutBtn {
|
||||
if (!_logoutBtn) {
|
||||
_logoutBtn = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
[_logoutBtn setTitle:@"Log Out" forState:UIControlStateNormal];
|
||||
[_logoutBtn setTitle:KBLocalized(@"Log Out") forState:UIControlStateNormal];
|
||||
[_logoutBtn setTitleColor:[UIColor colorWithHex:0xFF0000] forState:UIControlStateNormal];
|
||||
_logoutBtn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_logoutBtn.titleLabel.font = [KBFont medium:16];
|
||||
_logoutBtn.backgroundColor = UIColor.whiteColor;
|
||||
_logoutBtn.layer.cornerRadius = 12; _logoutBtn.layer.masksToBounds = YES;
|
||||
[_logoutBtn addTarget:self action:@selector(onTapLogout) forControlEvents:UIControlEventTouchUpInside];
|
||||
|
||||
@@ -281,8 +281,8 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
- (UILabel *)selectedLabel {
|
||||
if (!_selectedLabel) {
|
||||
_selectedLabel = [UILabel new];
|
||||
_selectedLabel.textColor = [UIColor colorWithHex:0x666666];
|
||||
_selectedLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
_selectedLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_selectedLabel.font = [KBFont medium:13];
|
||||
// _selectedLabel.text = @"Selected: 0 Skins";
|
||||
}
|
||||
return _selectedLabel;
|
||||
@@ -292,7 +292,7 @@ static NSString * const kMySkinCellId = @"kMySkinCellId";
|
||||
if (!_deleteButton) {
|
||||
_deleteButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
[_deleteButton setTitle:KBLocalized(@"Delete") forState:UIControlStateNormal];
|
||||
_deleteButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_deleteButton.titleLabel.font = [KBFont medium:13];
|
||||
_deleteButton.layer.cornerRadius = 18;
|
||||
_deleteButton.layer.borderWidth = 1;
|
||||
_deleteButton.clipsToBounds = YES;
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
if (!_coinLabel) {
|
||||
_coinLabel = [UILabel new];
|
||||
_coinLabel.text = @"690";
|
||||
_coinLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
|
||||
_coinLabel.font = [KBFont bold:20];
|
||||
_coinLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _coinLabel;
|
||||
@@ -221,7 +221,7 @@
|
||||
if (!_priceLabel) {
|
||||
_priceLabel = [UILabel new];
|
||||
_priceLabel.text = @"$6.90";
|
||||
_priceLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
_priceLabel.font = [KBFont medium:18];
|
||||
_priceLabel.textColor = [UIColor colorWithHex:KBColorValue];
|
||||
}
|
||||
return _priceLabel;
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.text = @"Become a member of LOVE KEY";
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:25 weight:UIFontWeightBold];
|
||||
_titleLabel.font = [KBFont bold:18];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
@@ -204,7 +204,7 @@
|
||||
_desLabel = [[UILabel alloc] init];
|
||||
_desLabel.text = @"Unlock all functions";
|
||||
_desLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_desLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
||||
_desLabel.font = [KBFont medium:14];
|
||||
}
|
||||
return _desLabel;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
if (!_nameLabel) {
|
||||
_nameLabel = [UILabel new];
|
||||
_nameLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_nameLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
_nameLabel.font = [KBFont medium:13];
|
||||
_nameLabel.text = @"Sdsd666";
|
||||
}
|
||||
return _nameLabel;
|
||||
@@ -114,8 +114,8 @@
|
||||
- (UILabel *)contentLabel {
|
||||
if (!_contentLabel) {
|
||||
_contentLabel = [UILabel new];
|
||||
_contentLabel.textColor = [UIColor colorWithWhite:0.25 alpha:1.0];
|
||||
_contentLabel.font = [UIFont systemFontOfSize:12];
|
||||
_contentLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_contentLabel.font = [KBFont regular:10];
|
||||
_contentLabel.numberOfLines = 2;
|
||||
_contentLabel.text = @"I Highly Recommend This App. It Taught Me How To Chat";
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.text = @"Monthly Subscription";
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:13];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
@@ -126,7 +126,7 @@
|
||||
_priceLabel = [UILabel new];
|
||||
_priceLabel.text = @"$4.49";
|
||||
_priceLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_priceLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
|
||||
_priceLabel.font = [KBFont bold:20];
|
||||
}
|
||||
return _priceLabel;
|
||||
}
|
||||
@@ -134,7 +134,7 @@
|
||||
if (!_strikeLabel) {
|
||||
_strikeLabel = [UILabel new];
|
||||
_strikeLabel.text = @"$4.49";
|
||||
_strikeLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightSemibold];
|
||||
_strikeLabel.font = [KBFont medium:20];
|
||||
_strikeLabel.textColor = [UIColor colorWithWhite:0.7 alpha:1.0];
|
||||
}
|
||||
return _strikeLabel;
|
||||
|
||||
@@ -50,7 +50,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.equalTo(self.view);
|
||||
}];
|
||||
self.kb_titleLabel.text = @"Recharge";
|
||||
self.kb_titleLabel.text = KBLocalized(@"Points Recharge");
|
||||
|
||||
// 默认数据(演示)
|
||||
self.data = @[
|
||||
@@ -123,7 +123,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
}];
|
||||
[self.agreementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.view);
|
||||
make.bottom.equalTo(self.agreementButton.mas_top).offset(-8);
|
||||
make.bottom.equalTo(self.agreementButton.mas_top).offset(0);
|
||||
}];
|
||||
|
||||
// 底部按钮
|
||||
@@ -261,8 +261,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
- (UILabel *)myPointsTitleLabel {
|
||||
if (!_myPointsTitleLabel) {
|
||||
_myPointsTitleLabel = [UILabel new];
|
||||
_myPointsTitleLabel.text = @"My Points";
|
||||
_myPointsTitleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_myPointsTitleLabel.text = KBLocalized(@"My Points");
|
||||
_myPointsTitleLabel.font = [KBFont medium:14];
|
||||
_myPointsTitleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _myPointsTitleLabel;
|
||||
@@ -272,7 +272,7 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
if (!_pointsLabel) {
|
||||
_pointsLabel = [UILabel new];
|
||||
_pointsLabel.text = @"4230"; // 示例值
|
||||
_pointsLabel.font = [UIFont systemFontOfSize:36 weight:UIFontWeightBold];
|
||||
_pointsLabel.font = [KBFont bold:30];
|
||||
_pointsLabel.textColor = [UIColor colorWithHex:KBColorValue];
|
||||
}
|
||||
return _pointsLabel;
|
||||
@@ -298,7 +298,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
if (!_rechargeLabel) {
|
||||
_rechargeLabel = [UILabel new];
|
||||
_rechargeLabel.text = KBLocalized(@"Recharge Now");
|
||||
_rechargeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
// _rechargeLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_rechargeLabel.font = [KBFont medium:14];
|
||||
_rechargeLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _rechargeLabel;
|
||||
@@ -333,7 +334,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
_payButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_payButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal];
|
||||
[_payButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal];
|
||||
_payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
// _payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_payButton.titleLabel.font = [KBFont medium:15];
|
||||
// 使用现有的切图(若不存在可退化为渐变图片)
|
||||
UIImage *bg = [UIImage imageNamed:@"recharge_now_icon"];
|
||||
if (bg) {
|
||||
@@ -352,7 +354,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
_agreementLabel = [UILabel new];
|
||||
|
||||
_agreementLabel.text = KBLocalized(@"By clicking Pay, you indicate your agreement to the"); // 简化文案
|
||||
_agreementLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightRegular];
|
||||
// _agreementLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightRegular];
|
||||
_agreementLabel.font = [KBFont regular:12];
|
||||
_agreementLabel.textColor = [UIColor colorWithWhite:0.45 alpha:1.0];
|
||||
}
|
||||
return _agreementLabel;
|
||||
@@ -362,8 +365,8 @@ static NSString * const kKBJfPayCellId = @"kKBJfPayCellId";
|
||||
_agreementButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_agreementButton setTitle:KBLocalized(@"《Embership Agreement》") forState:UIControlStateNormal];
|
||||
[_agreementButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal];
|
||||
_agreementButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold];
|
||||
|
||||
// _agreementButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightSemibold];
|
||||
_agreementButton.titleLabel.font = [KBFont regular:12];
|
||||
[_agreementButton addTarget:self action:@selector(agreementButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _agreementButton;
|
||||
|
||||
@@ -72,7 +72,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
}];
|
||||
[self.agreementLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.view);
|
||||
make.bottom.equalTo(self.agreementButton.mas_top).offset(-8);
|
||||
make.bottom.equalTo(self.agreementButton.mas_top).offset(0);
|
||||
}];
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.view);
|
||||
@@ -267,7 +267,8 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
_payButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_payButton setTitle:KBLocalized(@"Recharge Now") forState:UIControlStateNormal];
|
||||
[_payButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal];
|
||||
_payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
// _payButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_payButton.titleLabel.font = [KBFont medium:15];
|
||||
UIImage *bg = [UIImage imageNamed:@"recharge_now_icon"];
|
||||
if (bg) {
|
||||
[_payButton setBackgroundImage:bg forState:UIControlStateNormal];
|
||||
@@ -285,7 +286,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
if (!_agreementLabel) {
|
||||
_agreementLabel = [UILabel new];
|
||||
_agreementLabel.text = @"By clicking \"Pay\", you indicate your agreement to the";
|
||||
_agreementLabel.font = [UIFont systemFontOfSize:12];
|
||||
_agreementLabel.font = [KBFont regular:12];
|
||||
_agreementLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _agreementLabel;
|
||||
@@ -296,7 +297,7 @@ static NSString * const kKBVipReviewListCellId = @"kKBVipReviewListCellId";
|
||||
_agreementButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_agreementButton setTitle:@"《Embership Agreement》" forState:UIControlStateNormal];
|
||||
[_agreementButton setTitleColor:[UIColor colorWithHex:KBColorValue] forState:UIControlStateNormal];
|
||||
_agreementButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightSemibold];
|
||||
_agreementButton.titleLabel.font = [KBFont regular:12];
|
||||
[_agreementButton addTarget:self action:@selector(agreementButtonAction) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _agreementButton;
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
if (!_textField) {
|
||||
_textField = [[UITextField alloc] init];
|
||||
_textField.delegate = self;
|
||||
_textField.font = [UIFont systemFontOfSize:15];
|
||||
_textField.font = [KBFont medium:13];
|
||||
_textField.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
_textField.clearButtonMode = UITextFieldViewModeWhileEditing;
|
||||
_textField.returnKeyType = UIReturnKeySearch;
|
||||
@@ -104,7 +104,7 @@
|
||||
- (UIButton *)searchButton {
|
||||
if (!_searchButton) {
|
||||
_searchButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
_searchButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
_searchButton.titleLabel.font = [KBFont regular:14];
|
||||
[_searchButton setTitle:@"Search" forState:UIControlStateNormal];
|
||||
// 绿色样式
|
||||
[_searchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont medium:14];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightSemibold];
|
||||
_titleLabel.font = [KBFont regular:14];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
+ (CGSize)sizeForText:(NSString *)text {
|
||||
if (text.length == 0) { return CGSizeMake(40, 32); }
|
||||
CGSize s = [text sizeWithAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]}];
|
||||
CGSize s = [text sizeWithAttributes:@{NSFontAttributeName:[KBFont regular:13]}];
|
||||
// 两侧内边距 12 + 12,高度固定 32
|
||||
return CGSizeMake(ceil(s.width) + 24, 32);
|
||||
}
|
||||
@@ -40,7 +40,7 @@
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
_titleLabel.font = [KBFont regular:13];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
|
||||
@@ -192,8 +192,8 @@
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [UILabel new];
|
||||
_titleLabel.numberOfLines = 0;
|
||||
_titleLabel.text = @"Points\nMall"; // 两行展示
|
||||
_titleLabel.font = [UIFont systemFontOfSize:30 weight:UIFontWeightBold];
|
||||
_titleLabel.text = KBLocalized(@"Points\nMall"); // 两行展示
|
||||
_titleLabel.font = [KBFont medium:22];
|
||||
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||
}
|
||||
return _titleLabel;
|
||||
@@ -254,9 +254,9 @@
|
||||
- (UILabel *)myPointsLabel {
|
||||
if (!_myPointsLabel) {
|
||||
_myPointsLabel = [UILabel new];
|
||||
_myPointsLabel.text = @"My Points";
|
||||
_myPointsLabel.text = KBLocalized(@"My Points");
|
||||
_myPointsLabel.textColor = [UIColor colorWithHex:KBBlackValue];
|
||||
_myPointsLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
_myPointsLabel.font = [KBFont regular:14];
|
||||
}
|
||||
return _myPointsLabel;
|
||||
}
|
||||
@@ -274,7 +274,7 @@
|
||||
_amountLabel = [UILabel new];
|
||||
_amountLabel.text = @"88.00";
|
||||
_amountLabel.textColor = [UIColor colorWithHex:KBColorValue];
|
||||
_amountLabel.font = [UIFont systemFontOfSize:40 weight:UIFontWeightBold];
|
||||
_amountLabel.font = [KBFont bold:40];
|
||||
_amountLabel.adjustsFontSizeToFitWidth = YES;
|
||||
// _amountLabel.minimumScaleFactor = 0.7;
|
||||
}
|
||||
@@ -284,9 +284,9 @@
|
||||
- (UIButton *)rechargeButton {
|
||||
if (!_rechargeButton) {
|
||||
_rechargeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_rechargeButton setTitle:@"Recharge" forState:UIControlStateNormal];
|
||||
[_rechargeButton setTitle:KBLocalized(@"Recharge") forState:UIControlStateNormal];
|
||||
[_rechargeButton setTitleColor:[UIColor colorWithHex:KBBlackValue] forState:UIControlStateNormal];
|
||||
_rechargeButton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
_rechargeButton.titleLabel.font = [KBFont medium:13];
|
||||
UIImage *bg = [UIImage imageNamed:@"recharge_btn_bg"];
|
||||
[_rechargeButton setBackgroundImage:bg forState:UIControlStateNormal];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user