// // YOUPAILCCommonCell.m // LiveChat // // Created by 张灿 on 2018/4/13. // Copyright © 2018年 caicai. All rights reserved. // #import "YOUPAILCCommonCell.h" @implementation YOUPAILCCommonCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { self.selectionStyle = UITableViewCellSelectionStyleNone; //v1.5.6 适配暗黑模式 [self.contentView setBackgroundColor:LCWhiteColor]; [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ self.youpaiparrowImgView = [[UIImageView alloc]init]; self.youpaiparrowImgView.contentMode = UIViewContentModeScaleAspectFill; self.youpaiparrowImgView.image = [UIImage imageNamed:@"vqu_images_H_cell_arrow_gray"]; [self.contentView addSubview:self.youpaiparrowImgView]; [self.youpaiparrowImgView makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(@-15); make.top.equalTo((self.frame.size.height-13)/2); make.size.mas_equalTo(CGSizeMake(7, 13)); }]; self.youpaiparrowLabel = [[UILabel alloc]init]; self.youpaiparrowLabel.font = [UIFont systemFontOfSize:13]; self.youpaiparrowLabel.textColor = LCTextGray; self.youpaiparrowLabel.textAlignment = NSTextAlignmentRight; [self.contentView addSubview:self.youpaiparrowLabel]; [self.youpaiparrowLabel makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.youpaiparrowImgView.mas_left).offset(-15); make.top.equalTo((self.frame.size.height-20)/2); make.height.equalTo(@20); }]; self.youpaipheadLabel = [[UILabel alloc]init]; self.youpaipheadLabel.font = [UIFont boldSystemFontOfSize:15]; self.youpaipheadLabel.textColor = LCTextNormal; self.youpaipheadLabel.textAlignment = NSTextAlignmentLeft; [self.contentView addSubview:self.youpaipheadLabel]; [self.youpaipheadLabel makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView.left).offset(15); make.top.equalTo((self.frame.size.height-20)/2); make.height.equalTo(@20); }]; self.youpaipdataLabel = [[UILabel alloc]init]; self.youpaipdataLabel.font = [UIFont systemFontOfSize:14]; self.youpaipdataLabel.textColor = LCTextBlack; self.youpaipdataLabel.textAlignment = NSTextAlignmentRight; [self.contentView addSubview:self.youpaipdataLabel]; [self.youpaipdataLabel makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.youpaipheadLabel.right).offset(20); make.top.equalTo((self.frame.size.height-20)/2); make.height.equalTo(@20); make.right.equalTo(self.youpaiparrowImgView.left).offset(-11); }]; } - (void)layoutSubviews{ [self.youpaiparrowImgView updateConstraints:^(MASConstraintMaker *make) { make.right.equalTo(@-15); make.top.equalTo((self.frame.size.height-13)/2); make.size.mas_equalTo(CGSizeMake(7, 13)); }]; [self.youpaiparrowLabel updateConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.youpaiparrowImgView.left).offset(-15); make.top.equalTo((self.frame.size.height-20)/2); make.height.equalTo(@20); }]; [self.youpaipheadLabel updateConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView.left).offset(15); make.top.equalTo((self.frame.size.height-20)/2); make.height.equalTo(@20); }]; [self.youpaipdataLabel updateConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.youpaipheadLabel.right).offset(20); make.top.equalTo((self.frame.size.height-20)/2); make.height.equalTo(@20); }]; } @end