UITableView with dynamic cell heights — what do I need to do to fix scrolling down?

前端 未结 1 1634
面向向阳花
面向向阳花 2021-01-30 14:42

I am building a teensy tiny little Twitter client on the iPhone. Naturally, I\'m displaying the tweets in a UITableView, and they are of course of varying lengths. I\'m dynami

相关标签:
1条回答
  • 2021-01-30 15:31

    Sigh. Turns out I didn't tweak all the properties just quite well enough. But at least I'm rid of that bug. :)

    This behavior was fixed by being sure to check the "Clip Subviews" property of the UITableViewCell.

    The behavior was caused by declaring my tweet text label to be of the maximum height necessary -- when the subviews of the table cell were not clipped, the label in the cell above would render overtop of the cell below. This was not visible on the first rendering of the screen due to the order that the SDK renders the cells -- downward -- and how it stacks each one above the other.

    0 讨论(0)
提交回复
热议问题