1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //
- // SignUpSituationHeaderView.m
- // LN_School
- //
- // Created by 张嵘 on 2019/7/31.
- // Copyright © 2019 Danson. All rights reserved.
- //
- #import "SignUpSituationHeaderView.h"
- #import "SignUpSituationHeaderModel.h"
- @interface SignUpSituationHeaderView ()
- @property (nonatomic, readwrite, strong) UIButton *signUpNumBtn;
- @end
- @implementation SignUpSituationHeaderView
- #pragma mark - Life Cycle
- - (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- self.backgroundColor = UIColor.whiteColor;
- [self addSubview:self.signUpNumBtn];
- }
- return self;
- }
- - (void)layoutSubviews {
- [super layoutSubviews];
- [_signUpNumBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_offset(24);
- make.centerY.mas_equalTo(self);
- make.size.mas_equalTo(CGSizeMake((kScreenWidth - 72) / 2.f, self.bounds.size.height * 0.6));
- _signUpNumBtn.layer.cornerRadius = self.bounds.size.height * 0.3;
- }];
- }
- #pragma mark - Private Functions
- - (void)updateSecVUI:(__kindof HDSectionModel *)model {
- SignUpSituationHeaderModel *headerModel = model.headerObj;
- _signUpNumBtn.hidden = !headerModel.leftLabelText;
- [_signUpNumBtn setTitle:headerModel.leftLabelText? : @"" forState:UIControlStateNormal];
- }
- #pragma mark - LazyLoad
- - (UIButton *)signUpNumBtn {
- if (!_signUpNumBtn) {
- _signUpNumBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- [_signUpNumBtn setTitle:@"" forState:UIControlStateNormal];
- _signUpNumBtn.titleLabel.font = [UIFont systemFontOfSize:13];
- _signUpNumBtn.titleLabel.textAlignment = NSTextAlignmentLeft;
- _signUpNumBtn.titleLabel.textColor = UIColor.whiteColor;
- _signUpNumBtn.backgroundColor = RQPinkBlueColor;
- _signUpNumBtn.clipsToBounds = YES;
- }
- return _signUpNumBtn;
- }
- @end
|