Thursday, 15 January 2015

ios - Find X position of where user is dragging their finger in ScrollView -


I have a scrollview and I am looking at user input. I would like to know that his finger is currently on the X Plane. Is it possible through ScrollView and / or its representative or do I override the touch , etc.?

I assume that you set up your scroll view representative if you have done so You only need to implement scrollViewDidScroll: with the protocol ...

  - (zero) scrollViewDidScroll: (UIScrollView *) scrollView {CGPoint TouchPoint = [scrollView. PanGestureRecognizer Location InView: scrollView]; NSLog (@ "Touch Point: (% F,% F)", TouchPoint.X, Touch Point.i); }  

While the user is scrolling, this will be an update.

Additional information: Note that if you have something like UIPageControl , then it's navigating between your scroll view, The situation can be calculated based on the number of pages (i.e. if each page is 100 pixels wide, page 0 will start from 0 point, one point on page 100 etc.).


No comments:

Post a Comment