小编Far*_*han的帖子

CollectionView 方法 cellForItemAt indexPath:未被调用(Swift)

我已经使用过UICollectionViewController并且正在尝试将图像添加到我的集合视图单元格中,但UICollectionView方法没有被调用。

override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath as IndexPath) as! CircularCollectionViewCell
        cell.imageName = images[indexPath.row]
        return cell

    }
Run Code Online (Sandbox Code Playgroud)

xcode ios uicollectionview swift

2
推荐指数
1
解决办法
3336
查看次数

标签 统计

ios ×1

swift ×1

uicollectionview ×1

xcode ×1