Horizontal Scroll in UICollectionView when i scroll left or right the cell not position right ? For each index item i can see the next item coming at the edge and scrolling further more of next cell is coming out to the current index. I want to show only the current index item in scroll. I dont know if its a layout issue ? Any help would be really helpfull. I set my collection view minimum spacing to 0.
Asked
Active
Viewed 345 times
-1
-
collectionView.pagingEnabled = true – Alexandr Kolesnik Jul 29 '19 at 07:49
1 Answers
1
You can add this code.also make sure to add UICollectionViewDelegateFlowLayout
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: yourCollectionView.bounds.width, height: yourCollectionView.bounds.height)
}

Aniket Bhondave
- 115
- 5