我UICollectionViewDelegateFlowLayout
用来制作我的尺寸和高度,collectionViewCell
但是当我使用这个时,其中的约束cell
没有更新。
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: UIScreen.main.bounds.width - 30, height: self.height)
}
因此,委托方法设置了正确的大小,但单元格中的元素被剪切(未更新)。我的单元格约束在情节提要中设置。