Collection View Cells not appearing

前端 未结 14 827
迷失自我
迷失自我 2021-02-07 08:40

I want to display as many collectionViewCells with buttons as there are strings in my array. but when I start the simulator there is just the backgroun

相关标签:
14条回答
  • 2021-02-07 09:41

    I removed this code from my CollectionViewController.m file

    [self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:reuseIdentifier];
    

    and cell get appeared

    0 讨论(0)
  • 2021-02-07 09:43

    The items in the cell weren't showing up for me because I hadn't set tamic for each of the added subviews when programmatically adding subviews.

    subview.translatesAutoresizingMaskIntoConstraints = false
    
    0 讨论(0)
提交回复
热议问题