YOUPAILZHomeTagLabelCell.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // YOUPAILZHomeTagLabelCell.m
  3. // VQU
  4. //
  5. // Created by 肖浩然的mac on 2021/8/16.
  6. // Copyright © 2021 leo. All rights reserved.
  7. //
  8. #import "YOUPAILZHomeTagLabelCell.h"
  9. @interface YOUPAILZHomeTagLabelCell ()
  10. @property (nonatomic,weak) UIButton *youpaiptitleBtn;
  11. @end
  12. @implementation YOUPAILZHomeTagLabelCell
  13. - (instancetype)initWithFrame:(CGRect)frame {
  14. self = [super initWithFrame:frame];
  15. if (self) {
  16. [self youpaifinitUI];
  17. }
  18. return self;
  19. }
  20. - (void)youpaifinitUI{
  21. self.contentView.layer.cornerRadius = self.contentView.size.height/2.0;
  22. self.contentView.layer.masksToBounds = YES;
  23. UIButton *titleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  24. [titleBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  25. titleBtn.titleLabel.font = [UIFont systemFontOfSize:10];
  26. titleBtn.backgroundColor = HexColorFromRGB(0x4F4B5B);
  27. titleBtn.userInteractionEnabled = NO;
  28. [self.contentView addSubview:titleBtn];
  29. self.youpaiptitleBtn = titleBtn;
  30. [titleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  31. make.left.top.bottom.right.offset(0.0f);
  32. }];
  33. }
  34. - (void)youpaifreloadWithModel:(YOUPAILZlaber_listModel *)model{
  35. [self.youpaiptitleBtn setTitle:[NSString stringWithFormat:@"%@%ld",model.youpaipname,model.youpaipnum] forState:UIControlStateNormal];
  36. }
  37. @end