MORankNoDataView.m 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. //
  2. // MORankNoDataView.m
  3. // MiMoLive
  4. //
  5. // Created by MiMo on 2025/9/12.
  6. //
  7. #import "MORankNoDataView.h"
  8. @interface MORankNoDataView ()
  9. @property (nonatomic, strong) UIView *contentView;
  10. @property (nonatomic, strong) UIImageView *iconImgView;
  11. @property (nonatomic, strong) UILabel *descLabel;
  12. @end
  13. @implementation MORankNoDataView
  14. - (instancetype)initWithFrame:(CGRect)frame {
  15. if (self = [super initWithFrame:frame]) {
  16. [self setupUI];
  17. }
  18. return self;
  19. }
  20. - (void)setupUI {
  21. [self addSubview:self.contentView];
  22. [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
  23. make.edges.mas_equalTo(0);
  24. }];
  25. [self.contentView addSubview:self.iconImgView];
  26. [self.iconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.top.mas_equalTo(71);
  28. make.centerX.mas_equalTo(0);
  29. make.size.mas_equalTo(CGSizeMake(120, 120));
  30. }];
  31. [self.contentView addSubview:self.descLabel];
  32. [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.top.equalTo(self.iconImgView.mas_bottom).offset(18);
  34. make.left.mas_equalTo(48);
  35. make.right.mas_equalTo(-48);
  36. }];
  37. [self.contentView addSubview:self.sendButton];
  38. [self.sendButton mas_makeConstraints:^(MASConstraintMaker *make) {
  39. make.top.equalTo(self.descLabel.mas_bottom).offset(16);
  40. make.left.mas_equalTo(48);
  41. make.right.mas_equalTo(-48);
  42. make.height.mas_equalTo(48);
  43. }];
  44. }
  45. #pragma mark - Lazy
  46. - (UIView *)contentView {
  47. if (!_contentView) {
  48. _contentView = [[UIView alloc] init];
  49. }
  50. return _contentView;
  51. }
  52. - (UIImageView *)iconImgView {
  53. if (!_iconImgView) {
  54. _iconImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_rank_no_data"]];
  55. }
  56. return _iconImgView;
  57. }
  58. - (UILabel *)descLabel {
  59. if (!_descLabel) {
  60. _descLabel = [[UILabel alloc] init];
  61. _descLabel.text = NSLocalString(@"C60032");
  62. _descLabel.textColor = [MOTools colorWithHexString:@"#000000"];
  63. _descLabel.font = [MOTextTools regularFont:14];
  64. _descLabel.textAlignment = NSTextAlignmentCenter;
  65. _descLabel.numberOfLines = 0;
  66. }
  67. return _descLabel;
  68. }
  69. - (MORankBottomButton *)sendButton {
  70. if (!_sendButton) {
  71. _sendButton = [[MORankBottomButton alloc] initWithFrame:CGRectMake(0, 0, kScaleWidth(280), 48)];
  72. }
  73. return _sendButton;
  74. }
  75. @end