YOUPAIHRGuildCenterBtn.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // YOUPAIHRGuildCenterBtn.m
  3. // VQU
  4. //
  5. // Created by xiaohaoran on 2021/11/4.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAIHRGuildCenterBtn.h"
  9. @implementation YOUPAIHRGuildCenterBtn
  10. -(instancetype)initWithFrame:(CGRect)frame{
  11. if (self = [super initWithFrame:frame]) {
  12. [self youpaifsetSubView];
  13. }
  14. return self;
  15. }
  16. -(void)youpaifsetSubView{
  17. //title
  18. UILabel *youpaipcountL = [[UILabel alloc] init];
  19. youpaipcountL.font = LCFont(16.0f);
  20. youpaipcountL.textColor = [UIColor whiteColor];
  21. [self addSubview:youpaipcountL];
  22. self.youpaipcountL = youpaipcountL;
  23. [youpaipcountL mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.centerX.equalTo(self);
  25. make.top.offset(0.0f);
  26. }];
  27. //str
  28. UILabel *youpaiptitleL = [[UILabel alloc] init];
  29. youpaiptitleL.font = LCFont(12.0f);
  30. youpaiptitleL.textColor = [UIColor whiteColor];
  31. youpaiptitleL.textAlignment = NSTextAlignmentCenter;
  32. [self addSubview:youpaiptitleL];
  33. self.youpaiptitleL = youpaiptitleL;
  34. [youpaiptitleL mas_makeConstraints:^(MASConstraintMaker *make) {
  35. make.bottom.left.right.offset(0.0f);
  36. }];
  37. youpaiptitleL.textColor = HexColorFromRGB(0x9F9DA5);
  38. }
  39. - (void)setYoupaiptitleStr:(NSString *)youpaiptitleStr{
  40. _youpaiptitleStr = youpaiptitleStr;
  41. self.youpaiptitleL.text = youpaiptitleStr;
  42. }
  43. - (void)setYoupaipcount:(NSString*)youpaipcount{
  44. _youpaipcount = youpaipcount;
  45. self.youpaipcountL.text = [NSString stringWithFormat:@"%@",youpaipcount];
  46. }
  47. @end