1
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
@interface HomeHotCell()
|
@interface HomeHotCell()
|
||||||
// 左侧序号
|
// 左侧序号
|
||||||
@property (nonatomic, strong) UILabel *rankLabel;
|
@property (nonatomic, strong) UILabel *rankLabel;
|
||||||
|
@property (nonatomic, strong) UIView *yuanView;
|
||||||
// 左侧圆形头像占位
|
// 左侧圆形头像占位
|
||||||
@property (nonatomic, strong) UIView *avatarView;
|
@property (nonatomic, strong) UIView *avatarView;
|
||||||
// 标题
|
// 标题
|
||||||
@@ -24,6 +25,7 @@
|
|||||||
[super setupUI];
|
[super setupUI];
|
||||||
|
|
||||||
// 添加控件
|
// 添加控件
|
||||||
|
[self.contentView addSubview:self.yuanView];
|
||||||
[self.contentView addSubview:self.rankLabel];
|
[self.contentView addSubview:self.rankLabel];
|
||||||
[self.contentView addSubview:self.avatarView];
|
[self.contentView addSubview:self.avatarView];
|
||||||
[self.contentView addSubview:self.titleLabel];
|
[self.contentView addSubview:self.titleLabel];
|
||||||
@@ -35,6 +37,11 @@
|
|||||||
make.left.equalTo(self.contentView).offset(16);
|
make.left.equalTo(self.contentView).offset(16);
|
||||||
make.centerY.equalTo(self.contentView);
|
make.centerY.equalTo(self.contentView);
|
||||||
}];
|
}];
|
||||||
|
[self.yuanView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.right.equalTo(self.rankLabel).offset(2);
|
||||||
|
make.bottom.equalTo(self.rankLabel).offset(-3);
|
||||||
|
make.width.height.mas_equalTo(6);
|
||||||
|
}];
|
||||||
|
|
||||||
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.rankLabel.mas_right).offset(12);
|
make.left.equalTo(self.rankLabel.mas_right).offset(12);
|
||||||
@@ -85,8 +92,8 @@
|
|||||||
- (UILabel *)rankLabel {
|
- (UILabel *)rankLabel {
|
||||||
if (!_rankLabel) {
|
if (!_rankLabel) {
|
||||||
_rankLabel = [[UILabel alloc] init];
|
_rankLabel = [[UILabel alloc] init];
|
||||||
_rankLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
|
_rankLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||||
_rankLabel.textColor = [UIColor colorWithRed:0.15 green:0.55 blue:0.45 alpha:1.0];
|
_rankLabel.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||||
}
|
}
|
||||||
return _rankLabel;
|
return _rankLabel;
|
||||||
}
|
}
|
||||||
@@ -95,12 +102,22 @@
|
|||||||
if (!_avatarView) {
|
if (!_avatarView) {
|
||||||
_avatarView = [[UIView alloc] init];
|
_avatarView = [[UIView alloc] init];
|
||||||
_avatarView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1];
|
_avatarView.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1];
|
||||||
_avatarView.layer.cornerRadius = 26;
|
_avatarView.layer.cornerRadius = 28;
|
||||||
_avatarView.layer.masksToBounds = YES;
|
_avatarView.layer.masksToBounds = YES;
|
||||||
}
|
}
|
||||||
return _avatarView;
|
return _avatarView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIView *)yuanView {
|
||||||
|
if (!_yuanView) {
|
||||||
|
_yuanView = [[UIView alloc] init];
|
||||||
|
_yuanView.backgroundColor = [UIColor colorWithHex:0x26D3AA];
|
||||||
|
_yuanView.layer.cornerRadius = 3;
|
||||||
|
_yuanView.layer.masksToBounds = YES;
|
||||||
|
}
|
||||||
|
return _yuanView;
|
||||||
|
}
|
||||||
|
|
||||||
- (UILabel *)titleLabel {
|
- (UILabel *)titleLabel {
|
||||||
if (!_titleLabel) {
|
if (!_titleLabel) {
|
||||||
_titleLabel = [[UILabel alloc] init];
|
_titleLabel = [[UILabel alloc] init];
|
||||||
|
|||||||
Reference in New Issue
Block a user