Dynamic cell height with UITableViewCell auto-off when scrolling

I am trying to do something like loading various types of cells with a custom height in a uitableview. Tableview cells are subclasses and consist of labels with corresponding restrictions. Each cell has a dynamic height.

Now, even when my table reloads the data, I calculate the height needed to resize the cells and cache it in my model class, so I do not need to calculate the height when the data is displayed on the device.

To calculate the height, I used a tutorial from Ray Wenderlich , and I have the correct set of heights for objects.

Now a problem arises. Whenever I deactivate cells, the kind of little jerk that gives me an indication that my cell is crossed out while scrolling.

How can I make this movement smooth so that there are no jerks during scrolling?

Altitude gets assigned and gets a value according to the current type of data being loaded.

estimatedRowForIndexPath

I also call layoutIfNeeded from my cellForAtindexPath

Suggestions are welcome.

+4
source share
1 answer

It is very difficult to say without seeing your code in cellForRowAtIndexPath and not seeing your cells and their corresponding code. Here are some common questions that I would investigate:

?

, , ,

?

, (UIImage imageNamed:), , , . , .

cellForRowAtIndexPath?

, cellForRowAtIndexPath, ?

cellForRowAtIndexPath?

, , , xib, .., . , . , - cellForRowAtIndexPath, initWith... awakeFromNib (.. , , , , )

, ,

0

Source: https://habr.com/ru/post/1616885/


All Articles