MineIntroduceCell.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // MineIntroduceCell.m
  3. // KulexiuForTeacher
  4. //
  5. // Created by 王智 on 2022/4/2.
  6. //
  7. #import "MineIntroduceCell.h"
  8. @interface MineIntroduceCell ()
  9. @property (weak, nonatomic) IBOutlet UILabel *introduceLabel;
  10. @end
  11. @implementation MineIntroduceCell
  12. - (void)awakeFromNib {
  13. [super awakeFromNib];
  14. // Initialization code
  15. self.selectionStyle = UITableViewCellSelectionStyleNone;
  16. }
  17. - (void)configIntroduce:(NSString *)introduceString {
  18. if ([NSString isEmptyString:introduceString]) {
  19. introduceString = @"暂无简介内容";
  20. }
  21. NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
  22. [paragraphStyle setLineSpacing:4];//调整行间距
  23. NSMutableAttributedString *attrs = [[NSMutableAttributedString alloc] initWithString:introduceString attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x666666)}];
  24. self.introduceLabel.attributedText = attrs;
  25. }
  26. - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
  27. [super setSelected:selected animated:animated];
  28. // Configure the view for the selected state
  29. }
  30. @end