| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // 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
|