处理所有UI

This commit is contained in:
2025-11-07 21:57:42 +08:00
parent 96cd32ed99
commit b23c9a678b
9 changed files with 66 additions and 17 deletions

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_item_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_item_normal@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_item_selected@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_item_selected@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -49,7 +49,7 @@
// Masonry
[self.shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.contentView);
make.top.equalTo(self.contentView.mas_top).offset(36); //
make.top.equalTo(self.contentView.mas_top).offset(68 * 0.5); //
}];
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -63,9 +63,10 @@
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.cardView.mas_top).offset(78);
make.top.equalTo(self.badgeCircle.mas_bottom).offset(13);
make.left.equalTo(self.cardView.mas_left).offset(18);
make.right.equalTo(self.cardView.mas_right).offset(-18);
make.height.mas_equalTo(23);
}];
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -75,7 +76,7 @@
}];
[self.peopleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.descLabel.mas_bottom).offset(16);
make.top.equalTo(self.descLabel.mas_bottom).offset(8);
make.left.equalTo(self.cardView.mas_left).offset(18);
make.right.equalTo(self.cardView.mas_right).offset(-18);
}];
@@ -83,8 +84,8 @@
[self.actionBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.cardView.mas_left).offset(18);
make.right.equalTo(self.cardView.mas_right).offset(-18);
make.bottom.equalTo(self.cardView.mas_bottom).offset(-18);
make.height.mas_equalTo(56);
make.bottom.equalTo(self.cardView.mas_bottom).offset(-12);
make.height.mas_equalTo(32);
}];
}
@@ -157,8 +158,8 @@
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel new];
_titleLabel.textColor = [UIColor colorWithWhite:0 alpha:0.95];
_titleLabel.font = [UIFont systemFontOfSize:26 weight:UIFontWeightSemibold];
_titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
_titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
_titleLabel.textAlignment = NSTextAlignmentCenter;
}
return _titleLabel;
@@ -167,8 +168,8 @@
- (UILabel *)descLabel {
if (!_descLabel) {
_descLabel = [UILabel new];
_descLabel.textColor = [UIColor colorWithWhite:0.45 alpha:1];
_descLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightRegular];
_descLabel.textColor = [UIColor colorWithHex:0x9A9A9A];
_descLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
_descLabel.textAlignment = NSTextAlignmentCenter;
_descLabel.numberOfLines = 2;
}
@@ -178,8 +179,8 @@
- (UILabel *)peopleLabel {
if (!_peopleLabel) {
_peopleLabel = [UILabel new];
_peopleLabel.textColor = [UIColor colorWithRed:0.31 green:0.78 blue:0.63 alpha:1.0];
_peopleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
_peopleLabel.textColor = [UIColor colorWithHex:0x02BEAC];
_peopleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightRegular];
_peopleLabel.textAlignment = NSTextAlignmentCenter;
_peopleLabel.numberOfLines = 2;
}
@@ -189,10 +190,10 @@
- (UIButton *)actionBtn {
if (!_actionBtn) {
_actionBtn = [UIButton buttonWithType:UIButtonTypeCustom];
_actionBtn.layer.cornerRadius = 12.0;
_actionBtn.layer.cornerRadius = 4.0;
_actionBtn.layer.masksToBounds = YES;
[_actionBtn setTitleColor:UIColor.whiteColor forState:UIControlStateNormal];
_actionBtn.titleLabel.font = [UIFont systemFontOfSize:28 weight:UIFontWeightSemibold];
_actionBtn.titleLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightSemibold];
[_actionBtn addTarget:self action:@selector(tapAction) forControlEvents:UIControlEventTouchUpInside];
}
return _actionBtn;

View File

@@ -98,7 +98,7 @@
// Two columns each width = (width - spacing - lr insets)/2
CGFloat cellWidth = (w - spacing) / 2.0;
//
CGFloat cellHeight = 340.0;
CGFloat cellHeight = 234.0;
return CGSizeMake(floor(cellWidth), cellHeight);
}

View File

@@ -25,20 +25,24 @@
[self.view addSubview:self.myCategoryView];
[self.view addSubview:self.listContainerView];
self.listContainerView.scrollView.scrollEnabled = false;
NSArray *imageNames = @[@"crab", @"lobster", @"apple", @"carrot", @"grape", @"watermelon"];
NSArray *selectedImageNames = @[@"crab_selected", @"lobster_selected", @"apple_selected", @"carrot_selected", @"grape_selected", @"watermelon_selected"];
NSArray *imageNames = @[@"home_item_normal", @"home_item_normal", @"home_item_normal", @"home_item_normal", @"home_item_normal", @"home_item_normal"];
NSArray *selectedImageNames = @[@"home_item_selected", @"home_item_selected", @"home_item_selected", @"home_item_selected", @"home_item_selected", @"home_item_selected"];
self.myCategoryView.titles = self.titles;
// self.myCategoryView.titleColorGradientEnabled = YES;
self.myCategoryView.imageInfoArray = imageNames;
self.myCategoryView.cellBackgroundSelectedColor = [UIColor blackColor];
self.myCategoryView.cellBackgroundUnselectedColor = [UIColor colorWithHex:0xEAF8F4];
self.myCategoryView.titleColor = [UIColor colorWithHex:0x1B1F1A];
self.myCategoryView.titleSelectedColor = [UIColor whiteColor];
self.myCategoryView.titleFont = [UIFont systemFontOfSize:12];
self.myCategoryView.selectedImageInfoArray = selectedImageNames;
self.myCategoryView.loadImageBlock = ^(UIImageView *imageView, id info) {
NSString *imageName = info;
imageView.image = [UIImage imageNamed:imageName];
};
self.myCategoryView.imageZoomEnabled = YES;
self.myCategoryView.imageZoomEnabled = false;
self.myCategoryView.imageZoomScale = 1.3;
self.myCategoryView.averageCellSpacingEnabled = NO;