最好能有个demo,感激不尽~
认证高级PHP讲师
You can use autolayerout to set it in the storyboard. This is my general approach because it is simple and fast. Alternatively, you can use this protocol UICollectionViewDelegateFlowLayout
Rewrite a function of the collectionview below
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets { return sectionInsets }
Then define the following variable outside the function, which is the same as the value returned above.
private let sectionInsets = UIEdgeInsets(top: -5.0, left: 5.0, bottom: 0.0, right: 5.0)
For the rest, you can refer to this http://www.cnblogs.com/ios8/p...
Do you know how to set up OC? The interfaces are similar
Override this method, which is used to specify the interval, the upper, lower, left, and right intervals.
Welcome to follow Brother Biao’s technical blog: http://www.huangyibiao.com/
You can use autolayerout to set it in the storyboard. This is my general approach because it is simple and fast. Alternatively, you can use this protocol UICollectionViewDelegateFlowLayout
Rewrite a function of the collectionview below
Then define the following variable outside the function, which is the same as the value returned above.
For the rest, you can refer to this http://www.cnblogs.com/ios8/p...
Do you know how to set up OC? The interfaces are similar
Override this method, which is used to specify the interval, the upper, lower, left, and right intervals.
Welcome to follow Brother Biao’s technical blog: http://www.huangyibiao.com/