1.自适应cell的高度
NSString *String = self.eventDetail.ati_info;
CGFloat textContentHeight = ceilf([String boundingRectWithSize:CGSizeMake(SCREEN_WIDTH - 42 - 33, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:FontNeveLightWithSize(14.0)} context:nil].size.height);
return textContentHeight +18 * 2;
String 是你获得的字符串
2.
NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%0.0f people already signed up/Limited to %0.0f people",self.eventDetail.number_of_participants,self.eventDetail.ati_people_count]];
cell.peopleLabel.attributedText = [BaseFunction attributeStringWith:attributeString andAttributes:@{NSForegroundColorAttributeName:RGB(52, 101, 168)}];
额