单元格大小为UICollectionView的故障

时间:2016-09-13 01:28:34

标签: ios swift xcode uicollectionview

我有一个大小为

的UICollectionView单元格
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
     return CGSize(width: self.view.frame.width / 2 - 10,height: self.view.frame.width / 2 - 10)

enter image description here

enter image description here

但是在运行时

enter image description here

故事板

enter image description here

新!

滚动后视图很好

enter image description here

阵列开始 滚动前的视图

enter image description here

数组结束

enter image description here

再次开始数组 滚动后的视图

enter image description here

感谢。 我的手机出了什么问题?

0 个答案:

没有答案