阅读背景:

UICollectionView/UIScrollView滚动到指定的行

来源:互联网 
// 如果调用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];// 如果调用scrollToItemAtIndexPath不起作用
    // 需要先调用



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: