UIScrollView in UICollectionViewCell not working

I have UICollectionViewa custom one UICollectionViewCell. UICollectionViewscrolls horizontally, with each cell occupying the entire visible screen.

UICollectionViewCellhas subtext UIView, which in turn has subtext UIScrollView.

UIScrollViewDesigned to scroll vertically, but not to scroll. I tried scrolling customization contentSizewithout success.

I suspect that it is UIScrollViewnot receiving any touch events, and is not a size issue.

Any suggestions?

EDIT →

Now I am sure that this is a problem of events, and not something special for UIScrollView.

Now I have overridden the method pointInside:in UIViewin UICollectionViewCelland now I see that now it returns false every time I click on it. In this case, you might think that the tap event will propagate to the next view, but UIViewstill does not receive the event. I tried adding UIGestureRecognizerin UIView, but it never logs a tap.

Could there be something here that captures events that I don’t know about?

+5
source share
3 answers

I am trying to solve a similar problem with scrollview, and your change of events reminded me of this question (which solved my problem again) How can I use UIButton in an optional UICollection?

, UICollectionReusableView, UICollectionViewCell. , ( scrollview) .

. , UICollectionViewCell ? : UICollectionView

+1

userInteractionEnabled UIView UIScrollView

0

, , - , - . UIScrollView UICollectionReusableView, :

class CustomCellHeader: UICollectionViewCell {


}

<

class CustomCellHeader: UICollectionReusableView {


}

, UIScrollView !

0
source

All Articles