【发布时间】:2018-04-25 19:04:23
【问题描述】:
如何处理函数“NumberIteminSection”和“cellForItemAtIndex”中的两个collectionView 不知道在一个函数中处理两个collectionView? 如果有更好的方法请告诉我
【问题讨论】:
-
为
UICollectionView和cellForItemAtIndex:中的每一个创建一个IBOutlet,并且所有其他数据源方法都应该有一个参数UICollectionView,例如在numberOfItemsInSection:做if collectionView == myFirstCollection { return numberOfItemsInFirstCollection } else //it's mySecondCollectionView return numberOfItemsInSeconCollection跨度>