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