UITableView dynamic cell heights only correct after some scrolling

后端 未结 24 1243
误落风尘
误落风尘 2020-11-29 16:41

I have a UITableView with a custom UITableViewCell defined in a storyboard using auto layout. The cell has several multiline UILabels.

24条回答
  •  死守一世寂寞
    2020-11-29 17:20

    calling cell.layoutIfNeeded() inside cellForRowAt worked for me on ios 10 and ios 11, but not on ios 9.

    to get this work on ios 9 also, I call cell.layoutSubviews() and it did the trick.

提交回复
热议问题