// // MOTextAlertCell.m // MiMoLive // // Created by SuperC on 2023/11/2. // #import "MOTextAlertCell.h" @implementation MOTextAlertCell #pragma mark - View Cycle - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { self.selectionStyle = UITableViewCellSelectionStyleNone; self.backgroundColor = [UIColor clearColor]; self.clipsToBounds = YES; [self setupUI]; } return self; } - (void)setupUI//设置UI { [self.contentView addSubview:self.titleLab]; [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(15.0); make.centerY.equalTo(self.contentView).offset(0); make.right.equalTo(self.contentView).offset(-15.0); make.height.equalTo(@(20)); }]; UIView *lineView = [[UIView alloc] init]; lineView.backgroundColor = [MOTools colorWithHexString:@"#F0F0F0" alpha:1.0]; [self.contentView addSubview:lineView]; [lineView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView); make.height.equalTo(@0.5); make.right.equalTo(self.contentView); make.bottom.equalTo(self.contentView); }]; } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } - (UILabel *)titleLab { if (!_titleLab) { _titleLab = [[UILabel alloc] init]; _titleLab.font = [MOTextTools regularFont:16]; _titleLab.textColor = kBaseTextColor_1; _titleLab.textAlignment = NSTextAlignmentCenter; } return _titleLab; } @end