// // specialTopicHeadCell.m // ThePaperHD // // Created by scar1900 on 15/2/13. // Copyright (c) 2015年 scar1900. All rights reserved. // #import "specialTopicHeadCell.h" #import "AsyncImageView.h" #define LINETAG 3000 @interface specialTopicHeadCell() { CGFloat descHeight; NSInteger numOfLine; } //@property(nonatomic, strong)AsyncImageView *headImageView; @property(nonatomic, strong)RTLabel *headDescLabel; @end @implementation specialTopicHeadCell @synthesize specialBO = _specialBO; - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { // Initialization code self.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; self.selectionStyle = UITableViewCellSelectionStyleNone; // [self addSubview:self.headImageView]; [self addSubview:self.headDescLabel]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needrefreshNightMode:) name:REFRESHAFTERNIGHTMODE object:nil]; } return self; } - (void)needrefreshNightMode:(id)sender{ self.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; _headDescLabel.textColor = [UIColor colorWithHexString:TextBlack]; for (NSInteger i =0;i导读 | "; descStr = [descStr stringByAppendingString:specialBO.desc]; descHeight = returnTextHeightWithRTLabel(descStr, rect_screen.size.width-20, appFont(TEXT_FIVE_LEVELSIZE, NO), 10); self.headDescLabel.text = descStr; CGFloat height = returnTextHeightWithRTLabel(@"高度", rect_screen.size.width-20, appFont(TEXT_FIVE_LEVELSIZE, NO), 10) + 10; numOfLine = descHeight/height +1; // NSLog(@"height == %f, lineHeigh == %f",height,appFont(TEXT_FIVE_LEVELSIZE, NO).lineHeight); [self.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { if ([obj isKindOfClass:[UIView class]]) { UIView *subView = obj; if (subView.tag >= 3000) { [subView removeFromSuperview]; } } }]; for (NSInteger i =0;i