3

I have a vertically-scrolling scroll view that has a single subview. This subview has a couple of collection views. I want them to scroll horizontally. It doesn't work because they are inside the scroll view. The problem is that the pan/scrolling gesture is working just for the scroll view and it doesn't propagate to the collection views. I just see the scroll view scrolling. There is the same problem with tapping on a collection cell. This event just doesn't happen.

I already tried adding the gestures manually but I am not able to scroll the collection views.

How can I propagate all the gestures ?

Thank you !

[See Storyboard Image]1

rob mayoff
  • 375,296
  • 67
  • 796
  • 848
Antonio Sejas
  • 31
  • 2
  • 4
  • I think your autolayout not set its showing ambiguity for scrollview please check that first. – CodeChanger Apr 26 '17 at 13:00
  • why did you add collectionView inside scrollview ? – KKRocks Apr 26 '17 at 13:02
  • The red icon indicates that you do no shave all the constraints set up correctly. Fix your constraints, and see if that fixes your scrolling issue. (You would need to show more information if you want help figuring out which constraints are wrong/missing). – DonMag Apr 26 '17 at 14:36
  • @KKRocks Because I have two collection views with horizontal scroll and the scrollview has a vertical scroll (similar to apple store app). – Antonio Sejas Apr 26 '17 at 20:23
  • 1
    @CodeChanger and DonMag Thank you!!! You were right ! I solved the ambiguity and it started to work !!! :D You saved my day ! Thank you ! – Antonio Sejas Apr 26 '17 at 20:26
  • I have a same issue while adding collectionview in scrollview. I am trying to change height of my collection view and cell disappear. Please help me. – Ekta Padaliya Dec 30 '17 at 13:49
  • @DonMag I don't have autolayout errors, but still my horizontal collection view doesn't scroll inside of vertical scroll view. What may be wrong? – えるまる Jun 25 '19 at 10:16
  • @Erumaru - tough to say, without seeing what you have. Post a new question and include descriptions / images of how you have your constraints setup. – DonMag Jun 25 '19 at 12:07

0 Answers0