// // POImageTitleAlertCell.m // powerone // // Created by SuperYann on 2023/5/16. // Copyright © 2023 onecloud.ltd. All rights reserved. // #import "MOImageTitleAlertCell.h" @implementation MOImageTitleAlertCell #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.icon]; [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.contentView).offset(-45.0); make.centerY.equalTo(self.contentView).offset(0); make.width.equalTo(@(20.0)); make.height.equalTo(@(20.0)); }]; [self.contentView addSubview:self.titleLab]; [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.icon.mas_right).offset(8.0); make.centerY.equalTo(self.contentView).offset(0); make.width.greaterThanOrEqualTo(@(80)); 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); }]; } - (UIImageView *)icon { if (!_icon) { _icon = [[UIImageView alloc] init]; _icon.layer.masksToBounds = YES; } return _icon; } - (UILabel *)titleLab { if (!_titleLab) { _titleLab = [[UILabel alloc] init]; _titleLab.font = [UIFont systemFontOfSize:14.0]; _titleLab.textColor = [MOTools colorWithHexString:@"#000000" alpha:1.0]; _titleLab.textAlignment = NSTextAlignmentLeft; } return _titleLab; } - (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 } @end