UICollectionViewCell not forcing Cell Size

前端 未结 1 987
再見小時候
再見小時候 2021-01-29 01:02

I am using

func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) ->         


        
相关标签:
1条回答
  • 2021-01-29 01:26

    The problem is that in the storyboard your collection view's Estimate Size is configured to Automatic:

    You need to set it to None if you want your sizeForItemAt implementation to be obeyed rather than the internal constraints.

    0 讨论(0)
提交回复
热议问题