YOUPAIPickerViewHeader.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // YOUPAIPickerViewHeader.m
  3. // MSYOUPAI
  4. //
  5. // Created by admin on 2022/3/4.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "YOUPAIPickerViewHeader.h"
  9. @implementation YOUPAIPickerViewHeader
  10. -(UIView *)youpaiplineView{
  11. if(_youpaiplineView == nil){
  12. _youpaiplineView = [UIView new];
  13. _youpaiplineView.backgroundColor = LZF5F4F7Color;
  14. }
  15. return _youpaiplineView;
  16. }
  17. -(UIButton *)youpaipCancleBtn{
  18. if(_youpaipCancleBtn == nil){
  19. _youpaipCancleBtn = [UIButton new];
  20. _youpaipCancleBtn.titleLabel.font = LCFont15;
  21. [_youpaipCancleBtn setTitle:@"取消" forState:UIControlStateNormal];
  22. [_youpaipCancleBtn setTitleColor:LZA3AABEColor forState:UIControlStateNormal];
  23. }
  24. return _youpaipCancleBtn;
  25. }
  26. -(UIButton *)youpaipCommitBtn{
  27. if(_youpaipCommitBtn == nil){
  28. _youpaipCommitBtn = [UIButton new];
  29. _youpaipCommitBtn.titleLabel.font = LCFont15;
  30. [_youpaipCommitBtn setTitle:@"确认" forState:UIControlStateNormal];
  31. [_youpaipCommitBtn setTitleColor:LZ273145Color forState:UIControlStateNormal];
  32. }
  33. return _youpaipCommitBtn;
  34. }
  35. -(instancetype)initWithFrame:(CGRect)frame{
  36. if (self == [super initWithFrame:frame]){
  37. [self addSubview:self.youpaipCancleBtn];
  38. [self addSubview:self.youpaipCommitBtn];
  39. [self addSubview:self.youpaiplineView];
  40. [self youpaifmakeLayout];
  41. }
  42. return self;
  43. }
  44. -(void)youpaifmakeLayout{
  45. [_youpaipCancleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.left.mas_equalTo(44);
  47. make.centerY.mas_equalTo(0);
  48. // make.size.mas_offset(32);
  49. }];
  50. [_youpaipCommitBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  51. make.right.mas_equalTo(-44);
  52. make.centerY.mas_equalTo(0);
  53. // make.size.mas_offset(32);
  54. }];
  55. [_youpaiplineView mas_makeConstraints:^(MASConstraintMaker *make) {
  56. make.bottom.mas_equalTo(0);
  57. make.left.mas_equalTo(12);
  58. make.right.mas_equalTo(-12);
  59. make.height.mas_equalTo(0.5);
  60. }];
  61. }
  62. @end