user6520705
user6520705

Reputation: 705

UIColectionView Vertical Scrolling inside a Scrollview - Disable scrolling of the scrollview when scrolling in the area of the collection view

I have a collectionview that scrolls vertically. It is on top of a Scrollview that is also vertically scrolling. Is it possible to disable the scrollviews scrolling when the user scrolls in the area of the collectionview. I want to prevent the whole page from scrolling when just trying to scroll inside the collection view. Thank you. Coding in Swift.

Upvotes: 1

Views: 755

Answers (1)

ItsSgtMarv
ItsSgtMarv

Reputation: 105

Currently is your code as follows:

UIScrollView as the parent with the other two as children

  • UIScrollView
    • UIView
    • UICollectionView

If so all you should have to do is remove UICollectionView from within the UIScrollView like below:

  • UIScrollView
    • UIView
  • UICollectionView
    • UIView

Once you have done this you should be able to handle UICollectionView scrolling separately.

Also for future reference it might help us answer the question if you include what you current code looks like or some of the steps you have already tried to remedy the action.

Hope this helps!

Upvotes: -1

Related Questions