1、
[self.tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:_currentRow inSection:0] animated:YES scrollPosition:UITableViewScrollPositionMiddle];
首先使用selectRowAtIndexes: 選擇行數,滾動的話tableview的superview時scrollview,scrollview可以滾動到某個position 那么就要計算這個position position = table row height * index,就得到滾動的位置了。
UITableViewCell自動滾動到頂部
[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
2、繼承自scrollview的方法
[self.tableView setContentOffset:CGPointMake(0,0) animated:YES];
