diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index 0da26de..4da11d3 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -52,6 +52,7 @@ 047C65582EBCC06D0035E841 /* HomeRankCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C65572EBCC06D0035E841 /* HomeRankCardCell.m */; }; 047C655C2EBCD0F80035E841 /* UIView+KBShadow.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C655B2EBCD08E0035E841 /* UIView+KBShadow.m */; }; 047C655E2EBCD5B20035E841 /* UIImage+KBColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C655D2EBCD5B20035E841 /* UIImage+KBColor.m */; }; + 048908BC2EBE1FCB00FABA60 /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 048908BB2EBE1FCB00FABA60 /* BaseViewController.m */; }; 04A9FE0F2EB481100020DB6D /* KBHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FC97082EB31B14007BD342 /* KBHUD.m */; }; 04A9FE132EB4D0D20020DB6D /* KBFullAccessManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A9FE112EB4D0D20020DB6D /* KBFullAccessManager.m */; }; 04A9FE162EB873C80020DB6D /* UIViewController+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 04A9FE152EB873C80020DB6D /* UIViewController+Extension.m */; }; @@ -194,6 +195,8 @@ 047C655B2EBCD08E0035E841 /* UIView+KBShadow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+KBShadow.m"; sourceTree = ""; }; 047C655C2EBCD5B20035E841 /* UIImage+KBColor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+KBColor.h"; sourceTree = ""; }; 047C655D2EBCD5B20035E841 /* UIImage+KBColor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+KBColor.m"; sourceTree = ""; }; + 048908BA2EBE1FCB00FABA60 /* BaseViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = ""; }; + 048908BB2EBE1FCB00FABA60 /* BaseViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = ""; }; 04A9A67D2EB9E1690023B8F4 /* KBResponderUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBResponderUtils.h; sourceTree = ""; }; 04A9FE102EB4D0D20020DB6D /* KBFullAccessManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFullAccessManager.h; sourceTree = ""; }; 04A9FE112EB4D0D20020DB6D /* KBFullAccessManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFullAccessManager.m; sourceTree = ""; }; @@ -738,6 +741,8 @@ 04FC95C82EB1E4C9007BD342 /* BaseNavigationController.m */, 04FC95CA2EB1E780007BD342 /* BaseTabBarController.h */, 04FC95CB2EB1E780007BD342 /* BaseTabBarController.m */, + 048908BA2EBE1FCB00FABA60 /* BaseViewController.h */, + 048908BB2EBE1FCB00FABA60 /* BaseViewController.m */, ); path = VC; sourceTree = ""; @@ -1171,6 +1176,7 @@ 04FC95F12EB339A7007BD342 /* LoginViewController.m in Sources */, 04FC96142EB34E00007BD342 /* KBLoginSheetViewController.m in Sources */, 04A9FE1B2EB892460020DB6D /* KBLocalizationManager.m in Sources */, + 048908BC2EBE1FCB00FABA60 /* BaseViewController.m in Sources */, 04FC95D72EB1EA16007BD342 /* BaseTableView.m in Sources */, 0477BDF32EBB7B850055D639 /* KBDirectionIndicatorView.m in Sources */, 04FC95D82EB1EA16007BD342 /* BaseCell.m in Sources */, diff --git a/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/Contents.json new file mode 100644 index 0000000..10a98fd --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "hoem_love_key@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "hoem_love_key@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@2x.png b/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@2x.png new file mode 100644 index 0000000..4f1f2e1 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@3x.png b/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@3x.png new file mode 100644 index 0000000..a76dd63 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/hoem_love_key.imageset/hoem_love_key@3x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/Contents.json new file mode 100644 index 0000000..5c5e11f --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_ai_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_ai_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@2x.png b/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@2x.png new file mode 100644 index 0000000..e334153 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@3x.png b/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@3x.png new file mode 100644 index 0000000..1a4867e Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_ai_icon.imageset/home_ai_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/Contents.json new file mode 100644 index 0000000..f7f7caa --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_chat_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_chat_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@2x.png b/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@2x.png new file mode 100644 index 0000000..09dd0b9 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@3x.png b/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@3x.png new file mode 100644 index 0000000..762cf2d Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_chat_icon.imageset/home_chat_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/Contents.json new file mode 100644 index 0000000..37c6f7c --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_emotion_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_emotion_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@2x.png b/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@2x.png new file mode 100644 index 0000000..511516c Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@3x.png b/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@3x.png new file mode 100644 index 0000000..ed641e9 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_emotion_icon.imageset/home_emotion_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/Contents.json new file mode 100644 index 0000000..a1613b4 --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_keyboard_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_keyboard_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@2x.png b/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@2x.png new file mode 100644 index 0000000..7b21e24 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@3x.png b/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@3x.png new file mode 100644 index 0000000..91ae8fa Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_keyboard_icon.imageset/home_keyboard_icon@3x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/Contents.json b/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/Contents.json new file mode 100644 index 0000000..9a363b0 --- /dev/null +++ b/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "home_topvip_icon@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "home_topvip_icon@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@2x.png b/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@2x.png new file mode 100644 index 0000000..e5b93d6 Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@2x.png differ diff --git a/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@3x.png b/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@3x.png new file mode 100644 index 0000000..fd556ee Binary files /dev/null and b/keyBoard/Assets.xcassets/Home/home_topvip_icon.imageset/home_topvip_icon@3x.png differ diff --git a/keyBoard/Class/Base/VC/BaseViewController.h b/keyBoard/Class/Base/VC/BaseViewController.h new file mode 100644 index 0000000..3b32969 --- /dev/null +++ b/keyBoard/Class/Base/VC/BaseViewController.h @@ -0,0 +1,16 @@ +// +// BaseViewController.h +// keyBoard +// +// Created by Mac on 2025/11/7. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BaseViewController : UIViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/keyBoard/Class/Base/VC/BaseViewController.m b/keyBoard/Class/Base/VC/BaseViewController.m new file mode 100644 index 0000000..e736182 --- /dev/null +++ b/keyBoard/Class/Base/VC/BaseViewController.m @@ -0,0 +1,32 @@ +// +// BaseViewController.m +// keyBoard +// +// Created by Mac on 2025/11/7. +// + +#import "BaseViewController.h" + +@interface BaseViewController () + +@end + +@implementation BaseViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. + self.view.backgroundColor = [UIColor whiteColor]; +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/keyBoard/Class/Home/V/HomeHeadView.m b/keyBoard/Class/Home/V/HomeHeadView.m index b2f57c8..a97db12 100644 --- a/keyBoard/Class/Home/V/HomeHeadView.m +++ b/keyBoard/Class/Home/V/HomeHeadView.m @@ -11,6 +11,8 @@ @interface HomeHeadView() +@property (nonatomic, strong) UIImageView *loveKeyImageView; + // 顶部会员卡图片 @property (nonatomic, strong) UIImageView *vipImageView; // 主/副标题 @@ -43,6 +45,7 @@ #pragma mark - UI - (void)setupViews { +// [self addSubview:self.loveKeyImageView]; [self addSubview:self.vipImageView]; [self addSubview:self.titleLabel]; [self addSubview:self.subTitleLabel]; @@ -58,6 +61,13 @@ make.width.mas_equalTo(217); make.height.mas_equalTo(166); }]; + +// [self.loveKeyImageView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.top.equalTo(self.vipImageView.mas_centerY).offset(0); +// make.right.equalTo(self).offset(-16); +// make.width.mas_equalTo(335); +// make.height.mas_equalTo(117); +// }]; // 主标题 [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { @@ -82,7 +92,7 @@ make.top.equalTo(self.subTitleLabel.mas_bottom).offset(16); make.left.equalTo(self.mas_left).offset(16); make.right.equalTo(self.mas_right).offset(-16); - make.height.mas_equalTo(94); + make.height.mas_equalTo(80); }]; // 四个按钮等宽分布 @@ -128,7 +138,11 @@ @"Personalized\nKeyboard", @"Chat\nPersona", @"Emotional\nCounseling"]; - [self configureFeatureTitles:titles images:nil]; + NSArray *images = @[[UIImage imageNamed:@"home_ai_icon"], + [UIImage imageNamed:@"home_keyboard_icon"], + [UIImage imageNamed:@"home_chat_icon"], + [UIImage imageNamed:@"home_emotion_icon"]]; + [self configureFeatureTitles:titles images:images]; } #pragma mark - Public @@ -141,21 +155,6 @@ btn.textLabel.text = titles[i]; } UIImage *img = (i < images.count) ? images[i] : nil; - if (!img) { - // 生成一张柔和的渐变占位图 - CGSize s = btn.iconSize; - CGFloat cr = MIN(s.width, s.height) * 0.26; - UIColor *c1 = [UIColor colorWithHex:0xC9F7E9]; - UIColor *c2 = [UIColor colorWithHex:0xA6E6FF]; - if (i == 1) { c1 = [UIColor colorWithHex:0xD7E5FF]; c2 = [UIColor colorWithHex:0xBFD2FF]; } - if (i == 2) { c1 = [UIColor colorWithHex:0xEBD8FF]; c2 = [UIColor colorWithHex:0xDDBBFF]; } - if (i == 3) { c1 = [UIColor colorWithHex:0xD1F5DE]; c2 = [UIColor colorWithHex:0xB6EBCE]; } - img = [UIImage kb_gradientImageWithColors:@[c1, c2] - locations:nil - size:s - direction:KBGradientDirectionLeftTopToRightBottom - cornerRadius:cr]; - } btn.iconView.image = img; } } @@ -169,12 +168,19 @@ - (UIImageView *)vipImageView{ if (!_vipImageView) { _vipImageView = [[UIImageView alloc] init]; - _vipImageView.image = [UIImage imageNamed:@"home_vip_card"]; + _vipImageView.image = [UIImage imageNamed:@"home_topvip_icon"]; _vipImageView.contentMode = UIViewContentModeScaleAspectFit; - _vipImageView.backgroundColor = [UIColor redColor]; } return _vipImageView; } +- (UIImageView *)loveKeyImageView{ + if (!_loveKeyImageView) { + _loveKeyImageView = [[UIImageView alloc] init]; + _loveKeyImageView.image = [UIImage imageNamed:@"hoem_love_key"]; + _loveKeyImageView.contentMode = UIViewContentModeScaleAspectFit; + } + return _loveKeyImageView; +} - (UILabel *)titleLabel { if (!_titleLabel) { @@ -206,8 +212,8 @@ NSMutableArray *arr = [NSMutableArray arrayWithCapacity:4]; for (int i = 0; i < 4; i++) { KBTopImageButton *btn = [[KBTopImageButton alloc] init]; - btn.iconSize = CGSizeMake(46, 46); - btn.spacing = 5; + btn.iconSize = CGSizeMake(54, 44); + btn.spacing = 0; [self.featuresContainer addSubview:btn]; [arr addObject:btn]; } diff --git a/keyBoard/Class/Home/V/HomeHotCell.m b/keyBoard/Class/Home/V/HomeHotCell.m index 950316a..fa757c2 100644 --- a/keyBoard/Class/Home/V/HomeHotCell.m +++ b/keyBoard/Class/Home/V/HomeHotCell.m @@ -39,14 +39,14 @@ [self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.rankLabel.mas_right).offset(12); make.centerY.equalTo(self.contentView); - make.width.height.mas_equalTo(52); + make.width.height.mas_equalTo(56); }]; [self.actionButton mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self.contentView); make.right.equalTo(self.contentView).offset(-16); - make.width.mas_equalTo(64); - make.height.mas_equalTo(36); + make.width.mas_equalTo(56); + make.height.mas_equalTo(38); }]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { @@ -104,8 +104,8 @@ - (UILabel *)titleLabel { if (!_titleLabel) { _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; - _titleLabel.textColor = [UIColor colorWithWhite:0.1 alpha:1]; + _titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold]; + _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; } return _titleLabel; } @@ -113,9 +113,9 @@ - (UILabel *)subLabel { if (!_subLabel) { _subLabel = [[UILabel alloc] init]; - _subLabel.font = [UIFont systemFontOfSize:13]; - _subLabel.textColor = [UIColor colorWithWhite:0.5 alpha:1]; - _subLabel.numberOfLines = 1; + _subLabel.font = [UIFont systemFontOfSize:12]; + _subLabel.textColor = [UIColor colorWithHex:0x9A9A9A]; + _subLabel.numberOfLines = 2; } return _subLabel; } @@ -123,7 +123,7 @@ - (UIButton *)actionButton { if (!_actionButton) { _actionButton = [UIButton buttonWithType:UIButtonTypeCustom]; - _actionButton.layer.cornerRadius = 18; + _actionButton.layer.cornerRadius = 12; _actionButton.layer.masksToBounds = YES; _actionButton.titleLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold]; } diff --git a/keyBoard/Class/Home/V/KBPanModalView.m b/keyBoard/Class/Home/V/KBPanModalView.m index af6af3f..2a27572 100644 --- a/keyBoard/Class/Home/V/KBPanModalView.m +++ b/keyBoard/Class/Home/V/KBPanModalView.m @@ -45,7 +45,8 @@ // 该背景色会被 HWPanModal 用来设置容器的 _contentView 背景色 // 参考 Pods/HWPanModal/Sources/View/PanModal/HWPanModalContainerView.m: adjustPanContainerBackgroundColor // 想要改变外层白色底(截图中 _contentView)的颜色,只需改这里即可 - self.backgroundColor = [UIColor colorWithHex:0xE8FFF4]; // 柔和的绿色 +// self.backgroundColor = [UIColor colorWithHex:0xE8FFF4]; // 柔和的绿色 + self.backgroundColor = [UIColor clearColor]; // HWBackgroundConfig *config = [HWBackgroundConfig configWithBehavior:HWBackgroundBehaviorDefault]; // config.backgroundAlpha = 0; // [self.hw_dimmedView reloadConfig:config]; @@ -180,11 +181,11 @@ [self.leftBgImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.equalTo(self.secWhiteContentView); - make.bottom.equalTo(self.secWhiteContentView); +// make.bottom.equalTo(self.secWhiteContentView); }]; [self.rightBgImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.top.equalTo(self.secWhiteContentView); - make.bottom.equalTo(self.secWhiteContentView); +// make.bottom.equalTo(self.secWhiteContentView); }]; @@ -231,7 +232,7 @@ [self.topBar addSubview:self.underlineImageView]; // Masonry 约束 - CGFloat topPadding = 0; // 与顶部小指示器留点空间 + CGFloat topPadding = 12; // 与顶部小指示器留点空间 [self.topBar mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.secWhiteContentView); make.top.equalTo(self.secWhiteContentView).offset(topPadding); @@ -259,14 +260,14 @@ [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.topBar.mas_bottom).offset(8); - make.left.right.equalTo(self.secWhiteContentView).inset(16); + make.left.right.equalTo(self.secWhiteContentView).inset(20); make.bottom.equalTo(self.secWhiteContentView); }]; [self.personImageView mas_makeConstraints:^(MASConstraintMaker *make) { // 仍按页面整体的左右边距定位,保持与改层级前的视觉一致 make.left.equalTo(self).offset(46); - make.bottom.equalTo(self.topBar.mas_top).offset(20); + make.bottom.equalTo(self.topBar.mas_top).offset(11); make.width.mas_equalTo(53); make.height.mas_equalTo(81); }]; @@ -283,7 +284,7 @@ #pragma mark - Action - (void)onTapTopButton:(UIButton *)sender { - [self switchToIndex:sender.tag animated:YES]; + [self switchToIndex:sender.tag animated:false]; // [self hw_panModalSetNeedsLayoutUpdate]; } @@ -318,7 +319,6 @@ // 添加目标 // [self addChildViewController:target]; [self.containerView addSubview:target.view]; - target.view.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1]; [target.view mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.right.equalTo(self.containerView); make.bottom.equalTo(self.containerView).offset(-KB_TABBAR_HEIGHT); diff --git a/keyBoard/Class/Home/V/KBTopThreeView.m b/keyBoard/Class/Home/V/KBTopThreeView.m index 232ae77..be5fe95 100644 --- a/keyBoard/Class/Home/V/KBTopThreeView.m +++ b/keyBoard/Class/Home/V/KBTopThreeView.m @@ -43,7 +43,7 @@ [self.cardImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.avatarCircleView.mas_bottom).offset(-34); // 顶部悬浮重叠 make.left.right.equalTo(self); - make.height.mas_equalTo(KBFit(148)); + make.height.mas_equalTo(KBFit(158)); }]; @@ -129,6 +129,9 @@ @property (nonatomic, strong) KBTopThreeCardView *rightCard; /// 统一的底部加号按钮(移出卡片,放到 KBTopThreeView) @property (nonatomic, strong) UIButton *plusButton; +/// 左右卡片底部也有 plus 按钮 +@property (nonatomic, strong) UIButton *leftPlusButton; +@property (nonatomic, strong) UIButton *rightPlusButton; @end @implementation KBTopThreeView @@ -146,6 +149,8 @@ [self addSubview:self.centerCard]; [self addSubview:self.rightCard]; [self addSubview:self.plusButton]; + [self addSubview:self.leftPlusButton]; + [self addSubview:self.rightPlusButton]; // 横向均分布局 [self.centerCard mas_makeConstraints:^(MASConstraintMaker *make) { @@ -173,11 +178,25 @@ // 用 plusButton 来“撑起”本视图,且底部对齐 [self.plusButton mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.centerCard.mas_bottom).offset(12); - make.centerX.equalTo(self); - make.width.mas_equalTo(52); + make.centerX.equalTo(self); // 或改为 equalTo(self.centerCard) 以严格与中卡居中 + make.width.mas_equalTo(60); make.height.mas_equalTo(28); make.bottom.equalTo(self).offset(-8); }]; + + // 左右 plus 按钮,同样底部对齐,用它们一起撑起视图 + [self.leftPlusButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.leftCard.mas_bottom).offset(12); + make.centerX.equalTo(self.leftCard); + make.width.height.equalTo(self.plusButton); + make.bottom.equalTo(self).offset(-8); + }]; + [self.rightPlusButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.rightCard.mas_bottom).offset(12); + make.centerX.equalTo(self.rightCard); + make.width.height.equalTo(self.plusButton); + make.bottom.equalTo(self).offset(-8); + }]; } - (void)configWithItems:(NSArray *)items { @@ -214,4 +233,30 @@ return _plusButton; } +- (UIButton *)leftPlusButton { + if (!_leftPlusButton) { + _leftPlusButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_leftPlusButton setTitle:@"+" forState:UIControlStateNormal]; + [_leftPlusButton setTitleColor:[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] forState:UIControlStateNormal]; + _leftPlusButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _leftPlusButton.layer.cornerRadius = 14.0; + _leftPlusButton.layer.masksToBounds = YES; + _leftPlusButton.backgroundColor = [[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] colorWithAlphaComponent:0.15]; + } + return _leftPlusButton; +} + +- (UIButton *)rightPlusButton { + if (!_rightPlusButton) { + _rightPlusButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_rightPlusButton setTitle:@"+" forState:UIControlStateNormal]; + [_rightPlusButton setTitleColor:[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] forState:UIControlStateNormal]; + _rightPlusButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold]; + _rightPlusButton.layer.cornerRadius = 14.0; + _rightPlusButton.layer.masksToBounds = YES; + _rightPlusButton.backgroundColor = [[UIColor colorWithRed:0.20 green:0.65 blue:0.50 alpha:1.0] colorWithAlphaComponent:0.15]; + } + return _rightPlusButton; +} + @end diff --git a/keyBoard/Class/Home/VC/HomeHotVC.h b/keyBoard/Class/Home/VC/HomeHotVC.h index 2d43462..37b2ab3 100644 --- a/keyBoard/Class/Home/VC/HomeHotVC.h +++ b/keyBoard/Class/Home/VC/HomeHotVC.h @@ -9,7 +9,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface HomeHotVC : UIViewController +@interface HomeHotVC : BaseViewController // 列表 @property (nonatomic, strong) BaseTableView *tableView; @end diff --git a/keyBoard/Class/Home/VC/HomeHotVC.m b/keyBoard/Class/Home/VC/HomeHotVC.m index 402ec42..3b133df 100644 --- a/keyBoard/Class/Home/VC/HomeHotVC.m +++ b/keyBoard/Class/Home/VC/HomeHotVC.m @@ -29,8 +29,6 @@ - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [UIColor whiteColor]; - // 构建数据(演示) self.dataSource = @[ @{@"rank":@4, @"title":@"Ambiguous", @"sub":@"Be Neither Too Close Nor Too Distant, Want To ...", @"joined":@NO}, diff --git a/keyBoard/Class/Home/VC/HomeRankVC.h b/keyBoard/Class/Home/VC/HomeRankVC.h index 2e81a51..c9a3963 100644 --- a/keyBoard/Class/Home/VC/HomeRankVC.h +++ b/keyBoard/Class/Home/VC/HomeRankVC.h @@ -10,7 +10,7 @@ #import "JXCategoryListContainerView.h" NS_ASSUME_NONNULL_BEGIN -@interface HomeRankVC : UIViewController +@interface HomeRankVC : BaseViewController // 列表 @property (nonatomic, strong) UICollectionView *collectionView; @end diff --git a/keyBoard/Class/Home/VC/HomeRankVC.m b/keyBoard/Class/Home/VC/HomeRankVC.m index c7476f0..e0c8c88 100644 --- a/keyBoard/Class/Home/VC/HomeRankVC.m +++ b/keyBoard/Class/Home/VC/HomeRankVC.m @@ -21,7 +21,6 @@ - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. - self.view.backgroundColor = [UIColor grayColor]; self.titles = @[@"螃蟹啊斯柯达积分卡", @"小龙虾", @"苹果", @"胡萝卜", @"葡萄", @"西瓜"]; [self.view addSubview:self.myCategoryView]; [self.view addSubview:self.listContainerView]; diff --git a/keyBoard/KeyBoardPrefixHeader.pch b/keyBoard/KeyBoardPrefixHeader.pch index 967257e..7a7c720 100644 --- a/keyBoard/KeyBoardPrefixHeader.pch +++ b/keyBoard/KeyBoardPrefixHeader.pch @@ -33,6 +33,8 @@ #import "BaseNavigationController.h" #import "BaseTableView.h" #import "BaseCell.h" +#import "BaseViewController.h" + #import "KBLocalizationManager.h" // 全局多语言封装