From a18cbdc3e555cd21699f41eb244221867dca4623 Mon Sep 17 00:00:00 2001 From: edwinQQQ Date: Fri, 17 Oct 2025 15:45:07 +0800 Subject: [PATCH] refactor: update layout constraints and color wheel properties in EPSignatureColorGuideView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主要变更: 1. 调整 contentContainer 的约束,使其顶部距离父视图 100 像素,底部距离 30 像素。 2. 修改 subtitleLabel 和 selectedColorView 的顶部间距,分别调整为 8 和 20 像素。 3. 更新 colorWheelView 的大小逻辑,确保其宽度不超过 300 像素,并相应调整 radius 和 buttonSize 属性。 4. 调整 confirmButton 的顶部间距为 30 像素。 此更新旨在优化界面布局,提高用户体验。 --- .../Moments/Views/EPSignatureColorGuideView.m | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m b/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m index c204af3..82dfa7c 100644 --- a/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m +++ b/YuMi/E-P/Moments/Views/EPSignatureColorGuideView.m @@ -50,8 +50,9 @@ [self addSubview:self.contentContainer]; [self.contentContainer mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self); + make.top.equalTo(self).offset(100); make.leading.trailing.equalTo(self).inset(30); + make.bottom.lessThanOrEqualTo(self).offset(-30); }]; @@ -64,7 +65,7 @@ [self.contentContainer addSubview:self.subtitleLabel]; [self.subtitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.titleLabel.mas_bottom).offset(12); + make.top.equalTo(self.titleLabel.mas_bottom).offset(8); make.centerX.equalTo(self.contentContainer); make.leading.trailing.equalTo(self.contentContainer).inset(20); }]; @@ -80,7 +81,7 @@ [self.contentContainer addSubview:self.selectedColorView]; [self.selectedColorView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.subtitleLabel.mas_bottom).offset(30); + make.top.equalTo(self.subtitleLabel.mas_bottom).offset(20); make.centerX.equalTo(self.contentContainer); make.height.mas_equalTo(60); make.leading.trailing.equalTo(self.contentContainer).inset(40); @@ -89,15 +90,16 @@ [self.contentContainer addSubview:self.colorWheelView]; [self.colorWheelView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.selectedColorView.mas_bottom).offset(30); + make.top.equalTo(self.selectedColorView.mas_bottom).offset(20); make.centerX.equalTo(self.contentContainer); - make.size.mas_equalTo(CGSizeMake(360, 360)); + CGFloat wheelSize = MIN(300, [UIScreen mainScreen].bounds.size.width - 80); + make.size.mas_equalTo(CGSizeMake(wheelSize, wheelSize)); }]; [self.contentContainer addSubview:self.confirmButton]; [self.confirmButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.colorWheelView.mas_bottom).offset(50); + make.top.equalTo(self.colorWheelView.mas_bottom).offset(30); make.leading.trailing.equalTo(self.contentContainer).inset(20); make.height.mas_equalTo(56); make.bottom.equalTo(self.contentContainer); @@ -259,8 +261,9 @@ - (EPEmotionColorWheelView *)colorWheelView { if (!_colorWheelView) { _colorWheelView = [[EPEmotionColorWheelView alloc] init]; - _colorWheelView.radius = 100.0; - _colorWheelView.buttonSize = 54.0; + CGFloat wheelSize = MIN(300, [UIScreen mainScreen].bounds.size.width - 80); + _colorWheelView.radius = wheelSize / 3.0; + _colorWheelView.buttonSize = 48.0; __weak typeof(self) weakSelf = self; _colorWheelView.onColorTapped = ^(NSString *hexColor, NSInteger index) {