问题
does anyone know how to programatically scroll a table view to a section at index path. what i'm trying to do is have tableview with 2 sections and an if statement for example
if loading = true scroll the table view up to hide the first section
when finished loading scroll table view back down to show first section
回答1:
Here is the snippet:
NSIndexPath * indexPath = [NSIndexPath indexPathForRow:row inSection:section];
[_tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
来源:https://stackoverflow.com/questions/13069080/ios-scroll-to-a-section-in-a-uitable-view