// // MoreMenuTitleView.m // LekangGuard // // Created by ecell on 2022/10/20. // #import "MoreMenuTitleView.h" @interface MoreMenuTitleView () @property (nonatomic ,weak) UILabel *titleLabel; @end @implementation MoreMenuTitleView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = KKClearColor; [self subheadView]; } return self; } - (void)setTitleStr:(NSString *)titleStr { _titleStr = titleStr; self.titleLabel.text = titleStr; } - (void)subheadView { UILabel *line = [UILabel new]; line.backgroundColor = KKMainColor; [self addSubview:line]; [line mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self); make.left.equalTo(self).offset(10); make.size.mas_equalTo(CGSizeMake(3, 15)); }]; UILabel *titleLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(14) textColor:KKTextBlackColor text:@"" Radius:0]; self.titleLabel = titleLabel; [self addSubview:titleLabel]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(line.mas_right).offset(5); make.centerY.equalTo(self); }]; } /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. - (void)drawRect:(CGRect)rect { // Drawing code } */ @end