0
我想创建一个简单的collectionView像pinterest。我遇到了一个问题,我已经设置了图像中的边距,但是因为您可以看到中间边距为20,因为左右两边都是10,我怎么能让它也是10.我试过改变一些值,但它不起作用。CollectionView保证金不一样
拟合所有方向
有没有更好的办法?
func collectionView(collectionView : UICollectionView,layout collectionViewLayout:UICollectionViewLayout,sizeForItemAtIndexPath indexPath:NSIndexPath) -> CGSize
{
return CGSizeMake(self.collectionView!.frame.width/2-20, self.collectionView!.frame.width/2-20+50)
}
但我不能在UICollectionViewCells上使用禁忌。有没有更好的方式使它适合所有的方向,而不是我在sizeForItemAtIndexPath中所做的? – 2014-10-07 18:23:38