estimatedHeightForRowAt is not called on scroll

南楼画角 提交于 2020-01-05 05:28:09

问题


Why method estimatedHeightForRowAt of the UITableViewDelegate protocol is not called when we are scrolling UITableView?

Method estimatedHeightForRowAt is called only when we initialize UITableView.


回答1:


Method estimatedHeightForRowAt is called only when we initialize UITableView.

Correct. It is called for all rows up front, so we can estimate the whole height of the table content. That is exactly what it is for.

When you scroll and the new rows are about to appear, those are now real rows with real cells in them, so now you must give the real heights!



来源:https://stackoverflow.com/questions/40341652/estimatedheightforrowat-is-not-called-on-scroll

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!