iOS学习笔记iOS DeveloperiOS Developer

UIcollectionView布局的一个小Bug

2016-08-05  本文已影响241人  鲲鹏DP

问题描述

 let margin:CGFloat = 10
        let cellWH = (UIScreen.mainScreen().bounds.width - 4*margin)/3 
        itemSize = CGSize(width: cellWH, height: cellWH)
        minimumLineSpacing = margin
        minimumInteritemSpacing = margin
    sectionInset = UIEdgeInsets(top: margin, left: margin, bottom: 0, right: margin)

问题分析

解决办法:

   let cellWH = (UIScreen.mainScreen().bounds.width - 4*margin)/3 - 0.01
Snip20160805_6.png
上一篇下一篇

猜你喜欢

热点阅读