Author Topic: UIScrollView Bug / Issue  (Read 1508 times)

peterdhcp

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
UIScrollView Bug / Issue
« on: February 27, 2014, 05:03:09 AM »
About UIScrollView:
I want to check if user is dragging the scroll view or not,
but there are no public function or variable to let me to get the status at UIScrollView.
Then I have changed the UIScrollView class, set the mDragStarted to be public.
And set it to be true when user dragging or finished drag, set it to be false when user starting drag.

But I found a bug. The second last object cant be dragged if i set the mDragStarted to be true at the beginning.
I hope that I can have a public member function or variable to get the status of scroll view in the future.

Thanks so much

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIScrollView Bug / Issue
« Reply #1 on: February 27, 2014, 05:23:00 PM »
Add this function to UIScrollView:
  1.         /// <summary>
  2.         /// Whether the scroll view is being dragged.
  3.         /// </summary>
  4.  
  5.         public bool isDragging { get { return mPressed && mDragStarted; } }
mDragStarted is a private variable and you should not be touching it. Not sure why you are modifying it to begin with.