Author Topic: How to find scroll view position  (Read 3358 times)

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
How to find scroll view position
« on: July 06, 2012, 02:25:51 PM »
Hi,
I'm trying to figure out how to find out whether the scroll view is at one end of the scroll or the other so that I can show arrows if the scroll view can be scrolled in one direction or the other (ie whether it has reached the end or the beginning). I am using the clipped scroll view. Is there a property I can read to show the current position based on the max position?

-JJ

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to find scroll view position
« Reply #1 on: July 06, 2012, 07:21:57 PM »
If your draggable panel as a scroll bar, UIScrollBar.scrollValue can tell you exactly that. Otherwise you need to calculate it yourself in a similar fashion.

capitalj

  • Jr. Member
  • **
  • Thank You
  • -Given: 5
  • -Receive: 0
  • Posts: 88
    • View Profile
Re: How to find scroll view position
« Reply #2 on: July 06, 2012, 07:24:10 PM »
Ah ok, could I just somehow use an invisible scroll bar to get that value then?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: How to find scroll view position
« Reply #3 on: July 07, 2012, 12:09:25 AM »
You could, sure... or you could just use the same logic to calculate the position offset yourself.