PlaybackTableViewCell.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // PlaybackTableViewCell.m
  3. // BuguLive
  4. //
  5. // Created by GuoMs on 16/7/4.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import "PlaybackTableViewCell.h"
  9. #import "UIImageView+WebCache.h"
  10. #import "HMHotItemModel.h"
  11. @implementation PlaybackTableViewCell
  12. - (void)awakeFromNib
  13. {
  14. [super awakeFromNib];
  15. self.userIMg.clipsToBounds = YES;
  16. self.userIMg.layer.borderWidth = 1;
  17. self.userIMg.layer.borderColor = kAppBorderColor;
  18. self.userIMg.userInteractionEnabled = YES;
  19. self.backPlay.backgroundColor = RGB(255, 117, 81);
  20. self.levelImg.layer.masksToBounds = YES;
  21. self.levelImg.layer.cornerRadius = 15 / 2;
  22. UITapGestureRecognizer *tapPhoto = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(handleToMian:)];
  23. [self.userIMg addGestureRecognizer:tapPhoto];
  24. self.lineView.backgroundColor = kAppSpaceColor;
  25. }
  26. - (void)layoutSubviews
  27. {
  28. [super layoutSubviews];
  29. self.userIMg.layer.cornerRadius = CGRectGetHeight(self.userIMg.frame)/2;
  30. }
  31. #pragma mark 点击头像到主页
  32. - (void)handleToMian:(UITapGestureRecognizer *)tap
  33. {
  34. if ([self.delegate respondsToSelector:@selector(handleWithPlayBackMainPage:index:)])
  35. {
  36. NSInteger tag = tap.view.tag;
  37. [self.delegate handleWithPlayBackMainPage:tap index:tag];
  38. }
  39. }
  40. - (void)setValueForCell:(HMHotItemModel *)model index:(NSInteger)tag
  41. {
  42. self.userIMg.tag = tag;
  43. [self.userIMg sd_setImageWithURL:[NSURL URLWithString:model.head_image] placeholderImage:nil];
  44. self.userName.attributedText = [[NSMutableAttributedString alloc] initWithString:model.nick_name];
  45. self.SayLable.attributedText = [[NSMutableAttributedString alloc] initWithString:model.title];
  46. self.timeLable.text = model.begin_time_format;
  47. self.watchNamber.text = model.watch_number_format;
  48. [self.levelImg sd_setImageWithURL:[NSURL URLWithString:model.v_icon] placeholderImage:nil];
  49. }
  50. @end