在创建cell时- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
NSString * sttr = [NSString stringWithFormat:@"%@%@",arrayload[indexPath.row],arraymodeltext[indexPath.row]]; NSMutableAttributedString * strAttebute = [[NSMutableAttributedString alloc] initWithString:sttr ]; //设置行间距
NSMutableParagraphStyle * paragraphStlyle = [[NSMutableParagraphStyle alloc] init];
[paragraphStlyle setLineSpacing:IPHONEHIGHT()];
[strAttebute addAttribute:NSParagraphStyleAttributeName value:paragraphStlyle range:NSMakeRange(, sttr.length)]; [strAttebute addAttribute:NSForegroundColorAttributeName value:qianse range:NSMakeRange(, [arrayload[indexPath.row] length])]; full.labelText.attributedText = strAttebute; CGSize contentSize = [sttr boundingRectWithSize:CGSizeMake(ScreenWidth-IPHONEHIGHT(),MAXFLOAT ) options:NSStringDrawingUsesLineFragmentOrigin|NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:IPHONEWIDTH()]} context:NULL].size; full.labelText.size =CGSizeMake(contentSize.width, contentSize.height); height0 = contentSize.height; return full;