// // LDCommunityShareCell.m // YouHuiProject // // Created by liuxueli on 2018/11/27. // Copyright © 2018 kuxuan. All rights reserved. // #import "LDCommunityShareCell.h" @implementation LDCommunityShareCell - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.contentView.backgroundColor = [UIColor whiteColor]; [self initSubViews]; } return self; } -(void)initSubViews { [self.contentView addSubview:self.goodImg]; [self.contentView addSubview:self.tipeImg]; [self.contentView addSubview:self.shareLabel]; [self.tipeImg mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(FITSIZE(5)); make.width.mas_equalTo(FITSIZE(23)); make.height.mas_equalTo(FITSIZE(26)); }]; [self.goodImg mas_makeConstraints:^(MASConstraintMaker *make) { make.width.height.mas_equalTo(FITSIZE(106)); }]; [self.shareLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(FITSIZE(106)); make.height.mas_equalTo(FITSIZE(30)); make.bottom.mas_equalTo(self.goodImg.bottom); }]; } -(void)setModel:(LDCommunityDetailModel *)model { _model=model; _shareLabel.text=[NSString stringWithFormat:@"%@人分享",model.times]; [_goodImg sd_setImageWithURL:[NSURL URLWithString:model.img]]; } -(UIImageView *)tipeImg { if (!_tipeImg) { _tipeImg =[[UIImageView alloc]init]; } return _tipeImg; } -(UIImageView *)goodImg { if (!_goodImg) { _goodImg =[[UIImageView alloc]init]; } return _goodImg; } -(UILabel *)shareLabel { if (!_shareLabel) { _shareLabel =[[UILabel alloc]init]; _shareLabel.textColor=[UIColor YHColorWithHex:0x6E6E6E]; _shareLabel.textAlignment=NSTextAlignmentCenter; _shareLabel.font=[UIFont systemFontOfSize:FITSIZE(12)]; } return _shareLabel; } @end