UICollectionView adding UICollectionCell

后端 未结 3 1379
野性不改
野性不改 2020-11-30 22:03

When I try to put UICollectionCell to UICollectionView in Interface Builder I can\'t put it with unknown reasons. The cell is going to the tools ba

3条回答
  •  醉话见心
    2020-11-30 22:23

    Only UICollectionView inside StoryBoard have UICollectionViewCell inside. If use XIB, create a new XIB with CellName.xib, add CollectionViewCell to it, specify name of UICollectionView custom class. After that use registerNib.

    Sample code: https://github.com/lequysang/TestCollectionViewWithXIB

提交回复
热议问题