更新时间:2022-12-28 15:56:21
事实证明,围绕 estimatedRowHeight
和 reloadRows
的行为很奇怪,或者至少我不明白>;解决方案,通过一个切线相关的 SO 问题,是在行高可用时缓存行高,如果在 heightForRow
中可用,则返回该行高.
Turns out there's weird, or at least I don't understand it, behavior around estimatedRowHeight
and reloadRows
; solution, via a tangentially related SO question, was to cache the row heights as they become available and return that if available in heightForRow
.
我猜它不会在重新加载时重新计算高度或其他东西?真的不明白具体为什么会这样,但我很高兴它确实如此!
I guess it doesn't recalculate the heights, or something, on a reload? Really don't understand specifically WHY this works, but I'm happy it does!