指定UICollectionView滑動到指定位置
[cell.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:sender.selectedSegmentIndex inSection:0] atScrollPosition:(UICollectionViewScrollPositionLeft) animated:YES];
有時候會有問題苟径,可能是ScrollPosition和layout.scrollDirection沖突了休涤。
當(dāng)layout.scrollDirection = UICollectionViewScrollDirectionHorizontal時,應(yīng)選擇UICollectionViewScrollPositionLeft羞秤,以此類推锉桑,才能實現(xiàn)想要的結(jié)果仅仆。