Reputation: 137
So my problem is that every time that I'm trying to scroll, scroll view doesn't work. Only the scroll of the collection view is working.
I have my ViewController
and this subviews:
. View
.. Scrollview
... Label
... Image
... Label
... CollectionView (column of 2)
I tried to disable scroll in collection view but nothing is working as expected.
Upvotes: 11
Views: 25800
Reputation: 1398
From the information in the question it's hard to give a detailed answer. Just a little tip. You should carefully check 2 important things, when your are working with UIScrollView
:
contentSize
of your scroll view.Maybe this will help.
There are also some tips even you choose to disable scrollable for uicollectionView:
Upvotes: 5
Reputation: 2771
It's not considered good practice to put an UICollectionView
inside a UIScrollView
because this will result in some unwanted behavior since UICollectionView
is a descendant of the UIScrollView
class.
Instead of having a UIScrollView
with Label, Image, Label, CollectionView
, you could remove the UIScrollView
and add a UICollectionReusableView
as a header to the UICollectionView
. Inside this header you can put the Label, Image, Label
and that view will always stay on top of the UICollectionView
section you created the header for.
You could have a go at this and then come back to us if you run in to some problems :)
Upvotes: 24