| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- //
- // MOChooseTimeCell.m
- // MiMoLive
- //
- // Created by SuperC on 2023/12/13.
- //
- #import "MOChooseTimeCell.h"
- @implementation MOChooseTimeCell
- - (instancetype)initWithFrame:(CGRect)frame
- {
- if (self = [super initWithFrame:frame])
- {
- self.backgroundColor = [UIColor clearColor];
- [self setupUI];
- }
- return self;
- }
- - (void)setupUI{
- [self.contentView addSubview:self.bgView];
- [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self.contentView);
- }];
-
- [self.bgView addSubview:self.selectImg];
- [self.selectImg mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.bgView).offset(5.0);
- make.width.height.equalTo(@18.0);
- make.centerY.equalTo(self.bgView.mas_centerY);
- }];
-
- [self.bgView addSubview:self.titleLab];
- [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.selectImg.mas_right).offset(5.0);
- make.right.equalTo(self.bgView).offset(-5.0);
- make.top.bottom.equalTo(self.bgView);
- }];
- }
- - (void)setIsChoose:(BOOL)isChoose{
- _isChoose = isChoose;
-
- if(isChoose){
- [self.selectImg setImage:[UIImage imageNamed:@"icon_language_choose"]];
-
- self.bgView.layer.borderColor = [MOTools colorWithHexString:@"#FF9EEF" alpha:1.0].CGColor;
- self.bgView.backgroundColor = [UIColor whiteColor];
- }
- else{
- [self.selectImg setImage:[UIImage imageNamed:@"icon_language_no_choose"]];
-
- self.bgView.layer.borderColor = [MOTools colorWithHexString:@"#E0E0E0" alpha:1.0].CGColor;
- self.bgView.backgroundColor = [MOTools colorWithHexString:@"#E0E0E0" alpha:1.0];
- }
- }
- #pragma mark - Lazy
- - (UIView *)bgView{
- if(!_bgView){
- _bgView = [[UIView alloc] init];
- _bgView.backgroundColor = [UIColor whiteColor];
- _bgView.layer.cornerRadius = 35.0 / 2.0;
- _bgView.layer.masksToBounds = YES;
- _bgView.layer.borderWidth = 0.5;
- }
- return _bgView;
- }
- - (UIImageView *)selectImg{
- if (!_selectImg)
- {
- _selectImg = [[UIImageView alloc] init];
- _selectImg.clipsToBounds = YES;
- _selectImg.userInteractionEnabled = NO;
- [_selectImg setImage:[UIImage imageNamed:@"icon_language_choose"]];
- _selectImg.contentMode = UIViewContentModeScaleAspectFill;
- }
- return _selectImg;
- }
- - (UILabel *)titleLab{
- if (!_titleLab)
- {
- _titleLab = [[UILabel alloc] init];
- _titleLab.text = @"";
- _titleLab.font = [UIFont systemFontOfSize:14.0];
- _titleLab.textColor = [MOTools colorWithHexString:@"#3B383D" alpha:1.0];
- _titleLab.textAlignment = NSTextAlignmentLeft;
- _titleLab.numberOfLines = 0;
-
- }
- return _titleLab;
- }
- @end
|