ContributionLsitBottomView.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // ContributionLsitBottomView.m
  3. // BuguLive
  4. //
  5. // Created by 宋晨光 on 2021/3/24.
  6. // Copyright © 2021 xfg. All rights reserved.
  7. //
  8. #import "ContributionLsitBottomView.h"
  9. @implementation ContributionLsitBottomView
  10. - (instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. self.backgroundColor = [UIColor colorWithHexString:@"#2D2140"];
  15. [self setUpView];
  16. }
  17. return self;
  18. }
  19. -(void)setUpView{
  20. self.titleL = [[UILabel alloc]initWithFrame:CGRectMake(0, 38, 50, 20)];
  21. self.titleL.font = [UIFont systemFontOfSize:14];
  22. self.titleL.textColor = UIColor.whiteColor;
  23. self.titleL.textAlignment = NSTextAlignmentCenter;
  24. [self addSubview:self.titleL];
  25. _headImageView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 0, 46, 46)];
  26. self.headImageView.centerY = self.titleL.centerY;
  27. self.headImageView.layer.cornerRadius = 23;
  28. self.headImageView.layer.masksToBounds = YES;
  29. [self addSubview:self.headImageView];
  30. _nicknameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.headImageView.right + 10, self.headImageView.top, self.width - self.headImageView.right - 100, 20)];
  31. self.nicknameLabel.font = [UIFont systemFontOfSize:14];
  32. self.nicknameLabel.textColor = UIColor.whiteColor;
  33. [self addSubview:self.nicknameLabel];
  34. _rankImgV = [[UIImageView alloc] initWithFrame:CGRectMake(self.nicknameLabel.left, self.nicknameLabel.bottom + 5, 26, 13)];
  35. [self addSubview:self.rankImgV];
  36. _valueLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.rankImgV.right + 10, 0, self.width - self.rankImgV.right - 120, 20)];
  37. self.valueLabel.centerY = self.rankImgV.centerY;
  38. self.valueLabel.textColor = [UIColor.whiteColor colorWithAlphaComponent:0.4];
  39. self.valueLabel.font = [UIFont systemFontOfSize:12];
  40. [self addSubview:self.valueLabel];
  41. self.contentL = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 15 - 100, 0, 100, 30)];
  42. self.contentL.text = ASLocalizedString( @"未上榜");
  43. self.contentL.font = [UIFont systemFontOfSize:14];
  44. self.contentL.textColor = UIColor.whiteColor;
  45. self.contentL.textAlignment = NSTextAlignmentRight;
  46. self.contentL.centerY = self.titleL.centerY;
  47. [self addSubview:self.contentL];
  48. }
  49. @end