12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // HomeSchoolContentCell.m
- // smartRhino
- //
- // Created by niuzhen on 2020/9/21.
- // Copyright © 2020 tederen. All rights reserved.
- //
- #import "HomeSchoolContentCell.h"
- @implementation HomeSchoolContentCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- + (HomeSchoolContentCell *)configCell:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifer = @"HomeSchoolContentCell";
- HomeSchoolContentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifer];
- if (cell == nil) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"HomeSchoolContentCell" owner:nil options:nil] objectAtIndex:0];
- }
- return cell;
- }
- - (void)setDataText:(NSString *)text
- {
- if (ISEmpty(text) || text.length == 0) {
- return;
- }
- NSMutableAttributedString * attr = [[NSMutableAttributedString alloc] initWithString:text];
- NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
- [paragraphStyle setLineSpacing:8];
- [attr addAttributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSForegroundColorAttributeName:UIColorHex(0x666666),NSFontAttributeName:[UIFont systemFontOfSize:17.f]} range:NSMakeRange(0, [text length])];
- self.contentL.attributedText = attr;
- }
- @end
|