CoachArrangeClassFooterView.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // CoachArrangeClassFooterView.m
  3. // LN_School
  4. //
  5. // Created by 张嵘 on 2019/8/1.
  6. // Copyright © 2019 Danson. All rights reserved.
  7. //
  8. #import "CoachArrangeClassFooterView.h"
  9. @interface CoachArrangeClassFooterView ()
  10. @property (nonatomic, readwrite, strong) UIButton *addBtn;
  11. @end
  12. @implementation CoachArrangeClassFooterView
  13. #pragma mark - Life Cycle
  14. - (instancetype)initWithFrame:(CGRect)frame {
  15. self = [super initWithFrame:frame];
  16. if (self) {
  17. self.backgroundColor = RQBackGroundColor;
  18. [self addSubview:self.addBtn];
  19. }
  20. return self;
  21. }
  22. - (void)layoutSubviews {
  23. [super layoutSubviews];
  24. [_addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.center.mas_equalTo(self);
  26. make.size.mas_equalTo(CGSizeMake(self.bounds.size.width - 32, self.bounds.size.height - 32));
  27. }];
  28. }
  29. #pragma mark - Lazy Load
  30. - (UIButton *)addBtn {
  31. if (!_addBtn) {
  32. _addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  33. [_addBtn setTitle:@"添加教练排课" forState:UIControlStateNormal];
  34. _addBtn.titleLabel.textAlignment = NSTextAlignmentCenter;
  35. _addBtn.titleLabel.textColor = UIColor.whiteColor;
  36. _addBtn.backgroundColor = RQPinkBlueColor;
  37. _addBtn.titleLabel.numberOfLines = 0;
  38. _addBtn.titleLabel.font = [UIFont systemFontOfSize:16];
  39. _addBtn.layer.cornerRadius = 5;
  40. _addBtn.layer.masksToBounds = YES;
  41. }
  42. return _addBtn;
  43. }
  44. @end