美文网首页
让UITableView/UICollectionView自动滑

让UITableView/UICollectionView自动滑

作者: 北雪未央吾思卿如狂 | 来源:发表于2017-10-26 17:54 被阅读70次

//---------------UITableView---------------------

NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow:10 inSection:0];

[[self tableView] scrollToRowAtIndexPath:scrollIndexPath

atScrollPosition:UITableViewScrollPositionTop animated:YES];

//---------------UICollectionView------------------

NSIndexPath *scrollIndexPath = [NSIndexPath indexPathForRow:10 inSection:0];

self.collecView scrollToItemAtIndexPath:scrollIndexPath atScrollPosition:UICollectionViewScrollPositionTop animated:YES

相关文章

网友评论

      本文标题:让UITableView/UICollectionView自动滑

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