YOUPAIMineInfoHeadCell.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // YOUPAIMineInfoHeadCell.m
  3. // MSYOUPAI
  4. //
  5. // Created by admin on 2022/3/2.
  6. // Copyright © 2022 MS. All rights reserved.
  7. //
  8. #import "YOUPAIMineInfoHeadCell.h"
  9. #import "UIView+Category.h"
  10. @implementation YOUPAIMineInfoHeadCell
  11. -(UIImageView *)headImageView{
  12. if (_headImageView == nil){
  13. _headImageView = [UIImageView new];
  14. [_headImageView setContentMode:UIViewContentModeScaleAspectFill];
  15. [_headImageView ms_radius:18];
  16. }
  17. return _headImageView;
  18. }
  19. -(YOUPAIBubbleLabel *)bubbleLab{
  20. if (_bubbleLab == nil){
  21. _bubbleLab = [YOUPAIBubbleLabel new];
  22. _bubbleLab.text = @"上传本人头像+20钻石";
  23. }
  24. return _bubbleLab;
  25. }
  26. -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
  27. if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
  28. [self.contentView addSubview:self.headImageView];
  29. [self.contentView addSubview:self.bubbleLab];
  30. [self defualUI];
  31. [self makeLayout];
  32. }
  33. return self;
  34. }
  35. -(void)defualUI{
  36. self.titleLab.text = @"头像";
  37. }
  38. -(void)makeLayout{
  39. [super makeLayout];
  40. [_headImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  41. make.right.mas_equalTo(self.rightArrow.mas_left).offset(-8);
  42. make.centerY.mas_equalTo(self.rightArrow);
  43. make.size.mas_equalTo(36);
  44. }];
  45. [_bubbleLab mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.left.mas_equalTo(self.titleLab.mas_right).offset(2);
  47. make.centerY.mas_equalTo(self.titleLab);
  48. }];
  49. }
  50. @end