Subview frame is incorrect when creating UICollectionViewCell

后端 未结 4 1870
醉酒成梦
醉酒成梦 2020-12-24 11:17

The problem

I created a UICollectionViewController with a custom UICollectionViewCell. The custom cell contains a large and rectangular UIView (name

4条回答
  •  执笔经年
    2020-12-24 11:45

    I had the same issue with a UICollectionViewCell using auto layout constraints.

    I had to call layoutIfNeeded before I was configuring my subview that relied on the views frame width.

提交回复
热议问题