Jeff T
Jeff T

Reputation: 620

Issue with expanding/collapsing UITableView rows in section

I have an issue with expanding and collapsing UiTableView rows and not sure how to troubleshoot or what may be the cause. When the section expands it causes a jerking motion and other rows seem to move up and down.

Here is the issue: https://www.useloom.com/share/14c1cdd27e7844dcad31dad30d4aa1ce

When the row is toggled the following code is executed:

    section.showPrompts = !section.showPrompts;    
    [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationFade];

Upvotes: 0

Views: 76

Answers (1)

particleman
particleman

Reputation: 645

You could try batching the updates within

[self.tableview beginUpdates];
... your code ...
[self.tableview endUpdates];

so that all of the animations are synchronized.

Upvotes: 1

Related Questions