// // HDLSectionHeaderView.m // HDLSceneSiriDemo // // Created by ι™ˆε˜‰δΉ on 2021/11/26. // #import "HDLSectionHeaderView.h" #import "HDLSceneSiri.h" @implementation HDLSectionHeaderView - (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.frame = CGRectMake(0, 0, APP_SCREEN_WIDTH, 65); self.backgroundColor = UIColor.whiteColor; [self addSubview:self.titleLabel]; [self addSubview:self.messageLabel]; [self addSubview:self.lineView]; } return self; } - (UILabel *)titleLabel{ if (!_titleLabel) { _titleLabel = [self NewLabel:CGRectMake(16, 11, APP_SCREEN_WIDTH - 32, 22) font:Get_FontBoldWithSize(16) textColor:HEXCOLORA(0x4484F4, 1.0) text:@""]; _titleLabel.textAlignment = NSTextAlignmentLeft; } return _titleLabel; } - (UILabel *)messageLabel{ if (!_messageLabel) { _messageLabel = [self NewLabel:CGRectMake(16, 37, APP_SCREEN_WIDTH - 32, 17) font:Get_FontWithSize(12) textColor:HEXCOLORA(0xC0C7D4, 1.0) text:@""]; _messageLabel.textAlignment = NSTextAlignmentLeft; } return _messageLabel; } -(UIView*)lineView{ if(!_lineView){ _lineView = [[UIView alloc]initWithFrame:CGRectMake(16, 64, APP_SCREEN_WIDTH - 16, 1)]; _lineView.backgroundColor = HEXCOLORA(0xECEDEE , 1.0); } return _lineView; } - (UILabel *)NewLabel:(CGRect)frame font:(UIFont *)font textColor:(UIColor *)color text:(NSString *)text{ UILabel *label = [[UILabel alloc] initWithFrame:frame]; label.backgroundColor = [UIColor clearColor]; label.font = font; if (color != nil) { label.textColor = color; } label.text = text; return label; } // -(void)backButtonClick{ } -(void)setTitle:(NSString *)title{ self.titleLabel.text = title; } @end