btachoice.blogg.se

UiscrollView passes touches to supwerview while bouncing
UiscrollView passes touches to supwerview while bouncing













This should alleviate the problem when dragging a small bit after a tap. This is built into UIScrollView - take a look at the delaysContentTouches and canCancelContentTouches properties. Otherwise if tap event had recognized scroll must not happen. I need solution where scroll view wait enough to decide it is not tap event and only then make scroll.

uiscrollView passes touches to supwerview while bouncing

It seems even more terrible, due to some other functionality start to perform after handling tap (it must not perform when normal scrolling).

uiscrollView passes touches to supwerview while bouncing

When user make quasi tap my application tries to scroll to tapped M圜ontentView element and than immediately handle normal scrolling. But in this case I sometimes (when I tap, make smaaaal drag and release finger so tap is steel recognizable(lets called it quasi tap)) have both tap and scroll events and it leads to bugs for me even if scroll view is not scrolling when I begin tap. The best was to implement gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer: of UITapGestureRecogniser delegate. I found some same questions and answers but none of them satisfied me. So the main answer I hope to get is how to "properly" implement handling of tap action in M圜ontentView while MyScrollView is decelerating.

uiscrollView passes touches to supwerview while bouncing

The main behavior of MyScrollView is to 1)make sure that after scrolling one of M圜ontentView elements will be at center of screen and 2)to scroll to center of M圜ontentView if user taps on it. So there are about 3-4 visible M圜ontentView elements at a moment. Each M圜ontentView has width about one third of MyScrollView width. What is the simplest solution to handle tap action by subview while scroll view is scrolling? But when it scrolling content views does not receive tap action. All works fine when scroll view is not scrolling.

uiscrollView passes touches to supwerview while bouncing

In some of them I have UITapGestureRecogniser. Let’s say you want to have your UI change when a scroll view is bouncing (or over-scrolling).įirst you need to conform to the UIScrollViewDelegate methods, more specifically scrollViewDidScroll(_ scrollView: UIScrollView).I have custom UIScrollView subclass with some content views inside.















UiscrollView passes touches to supwerview while bouncing