uploadFileRecordTableViewHeadView.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // uploadFileRecordTableViewHeadView.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2023/11/20.
  6. //
  7. #import "uploadFileRecordTableViewHeadView.h"
  8. @implementation uploadFileRecordTableViewHeadView
  9. - (id)initWithFrame:(CGRect)frame{
  10. self = [super initWithFrame:frame];
  11. [self drawAnyView];
  12. return self;
  13. }
  14. - (void)drawAnyView{
  15. [self setBackgroundColor:[UIColor whiteColor]];
  16. _titleLabel = [[UILabel alloc] init];
  17. _titleLabel.textColor = [UIColor hwColor:@"#666666" alpha:1.0];
  18. _titleLabel.font = [UIFont systemFontOfSize:12.0];
  19. [self addSubview:_titleLabel];
  20. [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  21. make.left.mas_equalTo(15);
  22. make.right.mas_equalTo(100);
  23. make.top.mas_equalTo(0);
  24. make.bottom.mas_equalTo(0);
  25. }];
  26. _rightButton = [[UIButton alloc] init];
  27. [_rightButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
  28. _rightButton.titleLabel.font = [UIFont systemFontOfSize:12.0];
  29. _rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  30. [_rightButton addTarget:self action:@selector(didiClikButFun:) forControlEvents:UIControlEventTouchUpInside];
  31. [self addSubview:_rightButton];
  32. [_rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.width.mas_equalTo(150);
  34. make.right.mas_equalTo(-15);
  35. make.top.mas_equalTo(0);
  36. make.bottom.mas_equalTo(0);
  37. }];
  38. }
  39. - (void)didiClikButFun:(UIButton*)but
  40. {
  41. if(_didClickButFun){
  42. _didClickButFun();
  43. }
  44. }
  45. @end