いいえ。私のCollectionviewは正常に動作します。しかし、レイアウトを少し変更したい。 私は配列番号が異なる配列を持っていますので、array.count = 5、私は5つの項目が必要です。 これを私のCollectionviewに表示する方法がわかりません。行の異なる項目を持つCollectionview
ありがとうございました。
更新日:
すべての行は、たとえば6です。
しかし、私は数字の配列を扱う方法を知らない! UICollectionViewDelegateFlowLayoutのプロトコルの一部である
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
let numberOfCellInRow : Int = 6
let padding : Int = 1
let collectionCellWidth : CGFloat = (self.view.frame.size.width/CGFloat(numberOfCellInRow)) - CGFloat(padding)
return CGSize(width: collectionCellWidth, height: 200)
}