123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //
- // ASHomeTipCollectCell.m
- // Asteria
- //
- // Created by iOS on 2023/6/6.
- //
- #import "ASHomeTipCollectCell.h"
- @implementation ASHomeTipCollectCell
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- [self loadSubV];
- }
- return self;
- }
- - (void)loadSubV {
- self.contentView.backgroundColor = _F5F5F5;
- self.contentView.layer.masksToBounds = true;
- self.contentView.layer.cornerRadius = 4;
- [self.contentView addSubview:self.imgV];
- [self.contentView addSubview:self.titleLb];
- [self.imgV mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.titleLb);
- make.trailing.equalTo(self.titleLb.mas_leading).offset(-10);
- // make.top.leading.equalTo(self.contentView).offset(10);
- make.width.height.equalTo(@24);
- }];
-
- [self.titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.equalTo(self.contentView).offset(17);
- make.centerY.equalTo(self.contentView);
- make.width.equalTo(@120);
- make.height.equalTo(@34);
- // make.leading.equalTo(self.imgV.mas_trailing).offset(10);
- // make.top.equalTo(self.imgV);
- // make.trailing.equalTo(self.contentView).offset(-5);
- // make.bottom.equalTo(self.contentView).offset(-5);
- }];
- }
- - (UIImageView *)imgV {
- if (!_imgV) {
- UIImageView *imgV = [UIImageView baseImgV];
- imgV.contentMode = UIViewContentModeScaleAspectFit;
- _imgV = imgV;
- }
- return _imgV;
- }
- - (UILabel *)titleLb {
- if (!_titleLb) {
- UILabel *lb = [UILabel baseLb];
- lb.textColor = Col_000;
- lb.font = [UIFont fontWithName:Rob_Regular size:12];
- lb.textAlignment = NSTextAlignmentLeft;
- lb.numberOfLines = 0;
- lb.lineBreakMode = NSLineBreakByWordWrapping;
- lb.qmui_lineHeight = 17;
- _titleLb = lb;
- }
- return _titleLb;
- }
- @end
|