I\'m using an UICollectionView
on which I want to place seven cells side by side. The whole screen should be used for this. Currently, I\'m using the width of the c
Step 1: Implement UICollectionViewDelegateFlowLayout(if not done).
Step 2: Use delegate method of UICollectionViewDelegateFlowLayout.
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize
{
return CGSizeMake((UIScreen.mainScreen().bounds.width)/7,120); //use height whatever you wants.
}
Step 3: Go to XIB or StoryBoard where you have your CollectionView.
Step 4: In XIB or StoryBoard where you have your CollectionView, click on CollectionView.
Step 5: Go to InterfaceBuilder, then in second last tab (ie: Size Inspector) set Min Spacing
For Cells = 0
For Lines = 0
That it.