refactor: update layout constraints and color wheel properties in EPSignatureColorGuideView

主要变更:
1. 调整 contentContainer 的约束,使其顶部距离父视图 100 像素,底部距离 30 像素。
2. 修改 subtitleLabel 和 selectedColorView 的顶部间距,分别调整为 8 和 20 像素。
3. 更新 colorWheelView 的大小逻辑,确保其宽度不超过 300 像素,并相应调整 radius 和 buttonSize 属性。
4. 调整 confirmButton 的顶部间距为 30 像素。

此更新旨在优化界面布局,提高用户体验。
This commit is contained in:
edwinQQQ
2025-10-17 15:45:07 +08:00
parent f84044425f
commit a18cbdc3e5

View File

@@ -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) {