UICollectionView Cell + UiLabel with AutoLayout

后端 未结 6 797
醉酒成梦
醉酒成梦 2020-12-29 08:14

I\'m trying to pin an UILabel to it\'s parent cell. I added four constraints (top, leading, trailing, bottom) which works fine on iOS 8.0 but not on iOS 7.X

6条回答
  •  不知归路
    2020-12-29 08:50

    Overriding the custom cell's layoutSubviews is a possible workaround:

    override func layoutSubviews() {
        contentView.frame = bounds
        super.layoutSubviews()
    }
    

提交回复
热议问题