KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Whenever I call reloadRowsAtIndexPaths My UITableView contentOffset is removed, is there a delegate method I can use to catch the table view updating and set the Offset again so that it remains in place and does not animate into view, or simply prevent it doing this? I am setting the contentOffest in viewDidLoad: self.tableView.contentOffset = CGPointMake(0, 43); Here is an example usage: [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:[params valueForKey:@"index"], nil] withRowAnimation:UITableViewRowAnimationFade]; Which removes the contentOffset and animates it into view, which I do not want. More specifically this appears to occur when the row being reloaded is at indexPath.section 0 and indexPath.row 0, i.e. the top row. More Information I am calling reloadRowsAtIndexPaths after an asynchronous request to fetch an image from a server. It basically works like so: cellForRowAtIndexPath is called which checks for the presence of the thumb file on the disk, if the file is not present a placeholder is loaded in it's place and an asynchronous request is started in a background thread to fetch the image. When the image download has completed I call reloadRowsAtIndexPaths for the correct cell so that the correct image fades in in place of the placeholder image. The amount of cells may be different as the request is called inside cellForRowAtIndexPath so that the images load in as the cells load cellForRowAtIndexPath file check paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); path = [[paths objectAtIndex:0] stringByAppendingPathComponent:[NSString stringWithFormat:@"%@_small.gif",[[listItems objectAtIndex:indexPath.row] valueForKey:@"slug"]]]; if([[NSFileManag
Tags (comma-separated)
Save Edits
Cancel