WillDoCell.m 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // WillDoCell.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/4/19.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "WillDoCell.h"
  9. @implementation WillDoCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. // _shortTitleLabel.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@""]];
  13. // _shortTitleLabel.layer.masksToBounds = YES;
  14. // _shortTitleLabel.layer.cornerRadius = _shortTitleLabel.frame.size.height/2.0;
  15. _markNumLabel.backgroundColor = [UIColor redColor];
  16. _markNumLabel.layer.masksToBounds = YES;
  17. _markNumLabel.layer.cornerRadius = _markNumLabel.frame.size.height/2.0;
  18. }
  19. -(void)setImageName:(NSString *)imageName{
  20. UIImage *image = [UIImage imageNamed:imageName];
  21. // 1> 生成文本附件
  22. NSTextAttachment *textAttach = [[NSTextAttachment alloc] init];
  23. textAttach.image = image;
  24. textAttach.bounds = CGRectMake(0, 0, _shortTitleLabel.frame.size.width, _shortTitleLabel.frame.size.height);
  25. // 2> 使用文本附件创建属性文本
  26. NSAttributedString *strA = [NSAttributedString attributedStringWithAttachment:textAttach];
  27. _shortTitleLabel.attributedText = strA;
  28. }
  29. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  30. [super setSelected:selected animated:animated];
  31. // Configure the view for the selected state
  32. }
  33. @end