UICollectionView - How to add "PAGING" in UICollectionView scrolling with vertically

41 Views Asked by At

I have implemented UICollectionView with the vertical scrolling and paging, first image showing properly but after scrolling layout get changed.

Code -

// MARK: - UICollectionViewDelegateFlowLayout
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
    return CGSize(width: self.collectionView.frame.width, height: self.collectionView.frame.height)
}

I enable the paging from UICollectionView

Also attached images below.

First image showing properly but see the image second

Thanks in advance.

1

There are 1 best solutions below

0
keyur kathrotiya On BEST ANSWER

pls check below screen sort setting of collectionview into storyboard.

  • Estimate size none
  • others min spacing for cells & for lines are zero or not

enter image description here