//根据lable的值自适应大小
UIFont *fnt = [UIFont fontWithName:@"System" size:16.0f];
cell.name.font = fnt;
//获取内容的尺寸
CGSize size = [cell.name.text sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:fnt,NSFontAttributeName, nil]];
cell.name.frame = CGRectMake(78, 15, size.width, 21);
转载于:https://my.oschina.net/u/2556411/blog/671495