美文网首页ios开发
获取指定的section并滚动到顶部

获取指定的section并滚动到顶部

作者: Joseph_Zheng | 来源:发表于2015-04-13 17:29 被阅读2239次

获取位于tableview顶部的section,取所有可见的Cell第一个则为最顶部的,然后根据cell获取indexPath,

NSUInteger sectionNumber = 

[tableView indexPathForCell:_rightTableView.visibleCells.firstObject].section;

tableview滚动到指定的行:

[tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:inSection:indexPath.rowatScrollPosition:UITableViewScrollPositionTop animated:YES];

相关文章

网友评论

    本文标题:获取指定的section并滚动到顶部

    本文链接:https://www.haomeiwen.com/subject/rovkfttx.html