MONormalRightMenuCell.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // MONormalRightMenuCell.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2025/6/8.
  6. //
  7. #import "MONormalRightMenuCell.h"
  8. @implementation MONormalRightMenuCell
  9. - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  10. {
  11. if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
  12. {
  13. self.selectionStyle = UITableViewCellSelectionStyleNone;
  14. self.backgroundColor = [UIColor clearColor];
  15. [self setupUI];
  16. }
  17. return self;
  18. }
  19. - (void)setupUI{
  20. [self.contentView addSubview:self.contentLab];
  21. [self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
  22. make.edges.equalTo(self.contentView);
  23. }];
  24. }
  25. - (void)setCellModel:(NSDictionary *)cellModel{
  26. _cellModel = cellModel;
  27. NSString *nameStr = cellModel[@"name"];
  28. self.contentLab.text = nameStr;
  29. }
  30. - (void)awakeFromNib {
  31. [super awakeFromNib];
  32. // Initialization code
  33. }
  34. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  35. [super setSelected:selected animated:animated];
  36. // Configure the view for the selected state
  37. }
  38. - (UILabel *)contentLab{
  39. if (!_contentLab)
  40. {
  41. _contentLab = [[UILabel alloc] init];
  42. _contentLab.text = @"";
  43. _contentLab.font = [MOTextTools regularFont:13.0];
  44. _contentLab.textColor = [MOTools colorWithHexString:@"#2D2D2D" alpha:1.0];
  45. _contentLab.textAlignment = NSTextAlignmentCenter;
  46. _contentLab.numberOfLines = 1;
  47. }
  48. return _contentLab;
  49. }
  50. @end