KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a list of data that I'm pulling from a web service. I refresh the data and I want to insert the data in the table view above the current data, but I want to keep my current scroll position in the tableview. Right now I accomplish this by inserting a section above my current section, but it actually inserts, scrolls up, and then I have to manually scroll down. I tried disabling scrolling on the table before this, but that didn't work either. This looks choppy and seems hacky. What is a better way to do this? [tableView beginUpdates]; [tableView insertSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationNone]; [tableView endUpdates]; NSUInteger iContentOffset = 200; //height of inserted rows [tableView setContentOffset:CGPointMake(0, iContentOffset)];
Tags (comma-separated)
Save Edits
Cancel