Change UICollectionViewCell size on different device orientations

后端 未结 6 603
刺人心
刺人心 2020-12-12 09:36

I am using an UICollectionView with UICollectionViewFlowLayout.

I set the size of each cell through the

collectionView:lay         


        
6条回答
  •  借酒劲吻你
    2020-12-12 10:33

    There's a simple way to set collection view cell size:

    UICollectionViewFlowLayout *layout = (id) self.collectionView.collectionViewLayout;
    layout.itemSize = CGSizeMake(cellSize, cellSize);
    

    Not sure if it's animatable though.

提交回复
热议问题