ios开发

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

2015-04-13  本文已影响2239人  Joseph_Zheng

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

NSUInteger sectionNumber = 

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

tableview滚动到指定的行:

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

上一篇 下一篇

猜你喜欢

热点阅读