// // KXMainDetailTableViewCell.m // QBCS // // Created by kuxuan on 2017/6/6. // Copyright © 2017年 kuxuan. All rights reserved. // #import "KXMainDetailTableViewCell.h" @implementation KXMainDetailTableViewCell -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self==[super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self setupUI]; } return self; } -(void)setupUI { self.ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 14, 20, 20)]; [self.contentView addSubview:self.ImageView]; self.nameLabel=[[UILabel alloc]init]; self.nameLabel.textColor=[UIColor detailTitleColor]; self.nameLabel.font=FONT_SYS(14); self.nameLabel.numberOfLines=1; [self.contentView addSubview:self.nameLabel]; self.contentLabel=[[UILabel alloc]init]; self.contentLabel.font=FONT_SYS(14); self.contentLabel.preferredMaxLayoutWidth=SCREEN_WIDTH-2*LEADING_SPACE; [self.contentLabel sizeToFit]; self.contentLabel.textColor=[UIColor titleColor]; self.contentLabel.numberOfLines=0; [self.contentView addSubview:self.contentLabel]; [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.ImageView.mas_right).offset(10); make.top.equalTo(self.ImageView.mas_top); }]; [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView.mas_left).offset(LEADING_SPACE); make.top.equalTo(self.contentView.mas_top).offset(42); }]; self.lineLabel = [[UILabel alloc]init]; self.lineLabel.backgroundColor = [UIColor lineColor]; [self.contentView addSubview:self.lineLabel]; // [self.lineLabel mas_makeConstraints:^(MASConstraintMaker *make) { // make.left.equalTo(self.contentView); // make.right.equalTo(self.contentView); // make.height.mas_equalTo(0.5); // make.top.equalTo(self.contentView); // }]; } @end