已编辑
我正在使用自定义收集单元加载到collectionview中。但是,当集合视图加载预期的行为时,cellforindex委托将调用3索引路径,但在这种情况下仅调用3次第0个索引路径。
let nib = UINib(nibName: "cellName", bundle: nil)
self.collectionvView?.register(nib, forCellWithReuseIdentifier: "cellId")
func collectionView(_ collectionView: UICollectionView,
cellForItemAt indexPath: IndexPath) -> UICollectionViewCell
{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cellId",for: indexPath) as! DetailCollectionViewCell
}
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
{
return self.arrIds.count
}
全部检查