BGZanCell.m 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // BGZanCell.m
  3. // BuguLive
  4. //
  5. // Created by fanwe2014 on 2017/3/23.
  6. // Copyright © 2017年 xfg. All rights reserved.
  7. //
  8. #import "BGZanCell.h"
  9. #import "CommentModel.h"
  10. @implementation BGZanCell
  11. - (void)awakeFromNib {
  12. [super awakeFromNib];
  13. self.headImgView.layer.cornerRadius = 20;
  14. self.headImgView.layer.masksToBounds = YES;
  15. self.headImgView.userInteractionEnabled = YES;
  16. self.nameLabel.textColor = kAppGrayColor1;
  17. self.lineView = [[UIView alloc]initWithFrame:CGRectMake(60, 69,kScreenW-60,1)];
  18. self.lineView.backgroundColor = kAppSpaceColor2;
  19. [self addSubview:self.lineView];
  20. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(ImgViewTap:)];
  21. [self.headImgView addGestureRecognizer:tap];
  22. }
  23. - (void)creatCellWithModel:(CommentModel *)CModel andRow:(int)row
  24. {
  25. self.headImgView.tag = row;
  26. [self.headImgView sd_setImageWithURL:[NSURL URLWithString:CModel.head_image] placeholderImage:kDefaultPreloadHeadImg];
  27. if ([CModel.is_authentication intValue] != 2)
  28. {
  29. self.iconImgView.hidden = YES;
  30. }
  31. NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:CModel.nick_name];
  32. self.nameLabel.attributedText = attr;
  33. }
  34. #pragma mark 点击头像
  35. - (void)ImgViewTap:(UITapGestureRecognizer *)tap
  36. {
  37. if (self.ZHIDeleGate && [self.ZHIDeleGate respondsToSelector:@selector(ClickZanHeadImgViewWithTag:)])
  38. {
  39. [self.ZHIDeleGate ClickZanHeadImgViewWithTag:(int)tap.view.tag];
  40. }
  41. }
  42. @end