0
私は水平方向にスクロールするUICollectionViewを持っていて、一度に1つのセルを画面上に表示したいと思います。インセット、間隔、セクションのインセット(両方とも、プログラムおよびXcodeで検査官中で作業する方法を見つけ出すのに苦労した後Swift 3 - パディング付きUICollectionView Centerセル
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: indexPath as IndexPath) as! Cell
let width = collectionView.bounds.size.width - 40
let height = collectionView.bounds.size.height - 40
cell.bounds.size = CGSize(width: CGFloat(width), height: CGFloat(height))
return cell
}
そして:
私はプログラム的に以下の方法でセルの幅と高さを設定しています)私は何を設定する必要があるのか、どこに設定する必要があるのか分かりません。ここ
は私の所望の間隔を示す図である:20を左