1

Is there a specific way to know how many pixels a user moves a scrollview? I would dynamically resize a textview accordingly.

Thanks

Fran

Shaz
  • 15,637
  • 3
  • 41
  • 59
Sefran2
  • 3,578
  • 13
  • 71
  • 106

1 Answers1

1

Look at the UIScrollViewDelegate Protocol Reference. Specifically check the Responding to Scrolling and Dragging methods, from there you can check the contentOffset property of the scrollview which will give you the x and y offset from the origin.

EDIT: Added the proper name of the contentOffset property.

cesarislaw
  • 1,589
  • 1
  • 11
  • 21
  • Thanks... - (void) scrollViewDidScroll:(UIScrollView *)scrollView is good for me, the only problem is when I swipe up (that is I scroll down), 'cause the textview is scrollable and I can't recover the now hidden textfield over the textview, which is contained into the scrollview together with the textview. – Sefran2 Dec 14 '10 at 14:53