自写坑:轮播图

3个错误点

1,没自定义collectionViewCell

2,collectionView的section只设置了1个

3,定时器里面的@select(**), 方法**里面的  inSection:2  一直写的0

if (_index == self.images.count) {

        [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:2] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];

        _index = 1;

        _isScroll = YES;

    }else {

        [self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:_index inSection:1] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];

        _index +=  1;

    }

猜你喜欢

转载自www.cnblogs.com/zhangmazi/p/9302537.html
今日推荐