// 如果调用scrollToItemAtIndexPath不起作用
// 需要先调用layoutIfNeeded方法
[self layoutIfNeeded];
[_checkCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:_selectedCheckRow inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
[_recordCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:_selectedRecordRow inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
UICollectionView/UIScrollView滚动到指定的行
最新推荐文章于 2024-07-07 03:25:17 发布