标签:style blog io ar color os sp for on
如果tableView返回多个section,每个section中只有1个row,则在[_diaryTableView reloadData]后,加上
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:_contents.count - 1]; if (indexPath.section < [self numberOfSectionsInTableView:_diaryTableView]) { [_diaryTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; }
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:_contents.count - 1 inSection:0]; if (indexPath.row < [_diaryTableView numberOfRowsInSection:0]) { [_diaryTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES]; }
标签:style blog io ar color os sp for on
原文地址:http://blog.csdn.net/fanxiaoxuan1234/article/details/41725465