Auto Layout in UICollectionViewCell not working

后端 未结 4 496
灰色年华
灰色年华 2020-11-28 19:44

I have a simple UICollectionView with cells that have a single UITextView. The UITextView is constrained to the edges of the cell, so they should stay the same size as the c

4条回答
  •  失恋的感觉
    2020-11-28 20:10

    Swift 2.0:

    cell.contentView.frame = cell.bounds
    cell.contentView.autoresizingMask = [UIViewAutoresizing.FlexibleWidth, UIViewAutoresizing.FlexibleHeight]
    

提交回复
热议问题