DetailOnlyTextCell.m 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // DetailOnlyTextCell.m
  3. // model
  4. //
  5. // Created by MUMEI on 2018/8/6.
  6. // Copyright © 2018年 Mine. All rights reserved.
  7. //
  8. #import "DetailOnlyTextCell.h"
  9. @implementation DetailOnlyTextCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. UITapGestureRecognizer *Tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toImage:)];;
  13. [self.delLabel addGestureRecognizer:Tap];
  14. self.delLabel.userInteractionEnabled = YES;
  15. // [self setDetail];
  16. // Initialization code
  17. }
  18. - (void)toImage:(UITapGestureRecognizer*)recognizer {
  19. [self.delegate delPrivate:_model.privatepk];
  20. }
  21. - (void)setModel:(PrivateModel *)model{
  22. _model = model;
  23. [self setDetail];
  24. }
  25. - (void)setName:(NSString *)name{
  26. self.nameLabel.text = name;
  27. }
  28. - (void)setIcon:(NSString *)icon{
  29. [self.iconImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",imageURl,icon]] placeholderImage:[UIImage imageNamed:@"jiazai"]];
  30. }
  31. #pragma mark - labelTwo SizeToFitHeight
  32. - (void)setDetail
  33. {
  34. self.introLabel.text = _model.intro;
  35. self.introLabel.font = [UIFont systemFontOfSize:15];
  36. self.introLabel.numberOfLines = 0;
  37. CGFloat height = [UILabel getHeightByWidth:self.introLabel.frame.size.width title:self.introLabel.text font:self.introLabel.font];
  38. self.introLabel.frame = CGRectMake(64, 36, 295, height);
  39. self.dataLabel.text = _model.pdate;
  40. self.dataLabel.font = [UIFont systemFontOfSize:15];
  41. self.dataLabel.numberOfLines = 0;
  42. CGFloat width = [UILabel getWidthWithTitle:self.dataLabel.text font:self.dataLabel.font];
  43. self.dataWidth.constant = width;
  44. }
  45. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  46. [super setSelected:selected animated:animated];
  47. }
  48. @end