How to resize UITableViewCell to fit its content?

前端 未结 8 747
有刺的猬
有刺的猬 2020-12-08 05:34

I have a UITableview with multiple reusable TableViewCells. In one cell I have a UITextView, that resizes itself to fit its content. Now I \"just\

8条回答
  •  伪装坚强ぢ
    2020-12-08 06:01

    In case of UILabel subview in the UITableViewCell, I accomplished auto resize of the label just by setting the label's constraints (using storyboard, Xcode 8.3.2).

    This is working since apparently the label's and the cell's default behavior is sizeToFit. Same should work for UITextView as well.

提交回复
热议问题