This commit is contained in:
2025-11-17 14:53:23 +08:00
parent d9bfc30c88
commit 1d215ffdb3
19 changed files with 208 additions and 39 deletions

View File

@@ -61,6 +61,8 @@
@property (nonatomic, strong) UIView *cardView; //
@property (nonatomic, strong) UIStackView *topStack; // +
@property (nonatomic, strong) UIImageView *iconView; //
@property (nonatomic, strong) UIImageView *gradientImageView; //
@property (nonatomic, strong) UILabel *coinLabel; // 690
@property (nonatomic, strong) UILabel *priceLabel; // $6.90
@@ -76,6 +78,8 @@
self.contentView.backgroundColor = UIColor.clearColor;
[self.contentView addSubview:self.cardView];
[self.cardView addSubview:self.gradientImageView];
// +
[self.cardView addSubview:self.topStack];
[self.topStack addArrangedSubview:self.iconView];
@@ -86,6 +90,9 @@
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
}];
[self.gradientImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.cardView);
}];
[self.topStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.cardView).offset(16);
make.centerX.equalTo(self.cardView); //
@@ -177,7 +184,8 @@
if (!_cardView) {
_cardView = [UIView new];
// /
_cardView.backgroundColor = [UIColor colorWithWhite:0.98 alpha:1.0];
_cardView.backgroundColor = [UIColor colorWithHex:0xF1F1F1];
}
return _cardView;
}
@@ -190,6 +198,15 @@
return _iconView;
}
- (UIImageView *)gradientImageView{
if (!_gradientImageView) {
_gradientImageView = [[UIImageView alloc] init];
UIImage *gradientImage = [UIImage kb_gradientImageWithColors:@[[UIColor colorWithHex:0xF1F1F1], [UIColor colorWithHex:0xFFFFFF]] size:CGSizeMake(108, 116) direction:KBGradientDirectionTopToBottom];
_gradientImageView.image = gradientImage;
}
return _gradientImageView;
}
- (UILabel *)coinLabel {
if (!_coinLabel) {
_coinLabel = [UILabel new];