CustomCell 自适应高度+label自动换行+ UITextView 根据内容自动调整高度 TextView在上下左右分别有一个8px的padding,当使用[NSString sizeWithFont:constrainedToSize:lineBreakMode:]时,需要将UITextView.contentSize.width减去16像素(左右的padding 2 x 8px)。同时返回的高度中再加上16像素(上下的padding),这样得到的才是UITextView真正适应内容的高度。 示例代码如下: 1 + (float) heightForTextView: (UITextView *)textView WithText: (NSString *) strText{ 2