iOS 关于collectionView左滑问题

2018-09-06  本文已影响206人  被风吹乱的思念
Untitled4.gif

不知道大家有没有碰见这样的问题。


Untitled5.gif

我是这么解决的,一开始我做了45个数据源,后来我改成5个分区,每个分区9个数据源才好的,不知道大家有没有好的解决方案,或者是这样做的原理。欢迎告知!

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return 1;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return 45;
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return 5;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return 9;
}
上一篇 下一篇

猜你喜欢

热点阅读