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

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

作者: c5550ea746f8 | 来源:发表于2017-12-09 09:52 被阅读29次

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

NSUIntegersectionNumber =

[tableViewindexPathForCell:_rightTableView.visibleCells.firstObject].section;

tableview滚动到指定的行:

[tableViewscrollToRowAtIndexPath:[NSIndexPathindexPathForRow:0inSection:indexPath.row]atScrollPosition:UITableViewScrollPositionTopanimated:YES];

相关文章

网友评论

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

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