Answers for "how to set the spacing of a collection view swift"

0

how to set the spacing of a collection view swift

// Do any additional setup after loading the view, typically from a nib.
        let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
        layout.sectionInset = UIEdgeInsets(top: 20, left: 0, bottom: 10, right: 0)
        layout.itemSize = CGSize(width: screenWidth/3, height: screenWidth/3)
        layout.minimumInteritemSpacing = 0
        layout.minimumLineSpacing = 0
        collectionView!.collectionViewLayout = layout
Posted by: Guest on March-10-2020

Code answers related to "how to set the spacing of a collection view swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language