// // CoachArrangeClassHeaderView.m // LN_School // // Created by 张嵘 on 2019/8/1. // Copyright © 2019 Danson. All rights reserved. // #import "CoachArrangeClassHeaderView.h" @interface CoachArrangeClassHeaderView () @property (nonatomic, readwrite, strong) UILabel *progressLabel; @property (nonatomic, readwrite, strong) UILabel *objectLabel; @property (nonatomic, readwrite, strong) UILabel *dateLabel; @end @implementation CoachArrangeClassHeaderView #pragma mark - Life Cycle - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = RQBackGroundColor; [self addSubview:self.progressLabel]; [self addSubview:self.objectLabel]; [self addSubview:self.dateLabel]; } return self; } - (void)layoutSubviews { [super layoutSubviews]; [_progressLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.center.mas_equalTo(self); make.size.mas_equalTo(CGSizeMake(self.bounds.size.width / 3.f, self.bounds.size.height)); }]; [_dateLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_offset(0); make.centerY.mas_equalTo(self); make.size.mas_equalTo(_progressLabel); }]; [_objectLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_offset(0); make.centerY.mas_equalTo(self); make.size.mas_equalTo(_progressLabel); }]; } #pragma mark - Lazy Load - (UILabel *)progressLabel { if (!_progressLabel) { _progressLabel = [[UILabel alloc] init]; _progressLabel.text = @"进度"; _progressLabel.textAlignment = NSTextAlignmentCenter; _progressLabel.textColor = RQContentTextColor; _progressLabel.numberOfLines = 0; _progressLabel.font = [UIFont systemFontOfSize:16]; } return _progressLabel; } - (UILabel *)objectLabel { if (!_objectLabel) { _objectLabel = [[UILabel alloc] init]; _objectLabel.text = @"项目"; _objectLabel.textAlignment = NSTextAlignmentCenter; _objectLabel.textColor = RQContentTextColor; _objectLabel.numberOfLines = 0; _objectLabel.font = [UIFont systemFontOfSize:16]; } return _objectLabel; } - (UILabel *)dateLabel { if (!_dateLabel) { _dateLabel = [[UILabel alloc] init]; _dateLabel.text = @"日期"; _dateLabel.textAlignment = NSTextAlignmentCenter; _dateLabel.textColor = RQContentTextColor; _dateLabel.numberOfLines = 0; _dateLabel.font = [UIFont systemFontOfSize:16]; } return _dateLabel; } @end