Choppy scroll animation for UITableView in iOS8 using dynamic cell height

I am working on creating news where most cells have different heights from each other. Therefore, I use the new embedded Apple system to dynamically calculate row heights in iOS8.

The problem occurs when I have to load a new page. When I do this, then scroll back up, the size of the contents of the table will be smaller than necessary, and the loading of cells is really volatile. Therefore, when I start to scroll up, I will be in the 5th cell, and then suddenly the 4th camera will jump down. I attached the project if you want to see my code: https://github.com/KhanFu/TableView-Dynamic-Cell-Height-Pagination

If you follow the table view, you will see that it jumps up. To re-create the error, first scroll to the end to load the next page (11, 12, and 13). Then start scrolling up. For a clearer version of this, watch out for number 7. Watch how it almost instantly becomes 6.

Essentially, when the offset of the contents of the table reaches the bottom of the table, I add an object to the data in the table, then add a row with insertRowsAtIndexPaths.

For several seconds I was banging my head about this problem. Let me know if you need more information. Thanks!

+6
source share

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


All Articles