YOUPAIHRSearchHeaderCell.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // YOUPAIHRSearchHeaderCell.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/11/9.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRSearchHeaderCell.h"
  9. @implementation YOUPAIHRSearchHeaderCell
  10. - (instancetype)initWithFrame:(CGRect)frame {
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. [self youpaifinitUI];
  14. }
  15. return self;
  16. }
  17. - (void)youpaifinitUI{
  18. self.contentView.layer.cornerRadius = self.contentView.size.height/2.0;
  19. self.contentView.layer.masksToBounds = YES;
  20. UILabel *youpaiptitleBtn = [UILabel new];
  21. self.youpaiptitleBtn = youpaiptitleBtn;
  22. [self.contentView addSubview:youpaiptitleBtn];
  23. [youpaiptitleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.top.bottom.offset(0.0f);
  25. make.left.mas_equalTo(6);
  26. make.right.mas_equalTo(-6);
  27. }];
  28. youpaiptitleBtn.font = [UIFont systemFontOfSize:12];
  29. youpaiptitleBtn.layer.cornerRadius = 12.5;
  30. youpaiptitleBtn.layer.masksToBounds = YES;
  31. youpaiptitleBtn.textAlignment = NSTextAlignmentCenter;
  32. youpaiptitleBtn.lineBreakMode = NSLineBreakByTruncatingTail;
  33. youpaiptitleBtn.backgroundColor = HexColorFromRGBA(0xA3AABE, 0.1);
  34. }
  35. -(void)setYoupaipnameStr:(NSString *)youpaipnameStr{
  36. _youpaipnameStr = youpaipnameStr;
  37. self.youpaiptitleBtn.text = youpaipnameStr;
  38. self.youpaiptitleBtn.textColor = LZ273145Color;
  39. }
  40. @end