1.NSString *actions = @"dsadas";
2.actionsLable.text = actions;
3.actionsLable.numberOfLines = 0;
第2步和第3步顺序不能颠倒。不然tableview高度拉不上去
+(CGSize)GetContentSizeContentWidth:(CGFloat)contentwidth ContentFont:(CGFloat)font Content:(NSString *)content
{
// 用何種字體進行顯示
UIFont *contentfont = [UIFont fontWithName:@"Arial" size:font];
// 該行要顯示的內容
NSLog(@"%@",content);
// 計算出顯示完內容需要的最小尺寸
return [content sizeWithFont:contentfont constrainedToSize:CGSizeMake(contentwidth, 1500) lineBreakMode:UILineBreakModeWordWrap];
}