Welcome,
Guest
. Please
login
or
register
.
May 26, 2026, 04:02:43 AM
Home
Help
Search
Login
Register
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UIScrollview scroll offset
« previous
next »
Print
Pages: [
1
]
Author
Topic: UIScrollview scroll offset (Read 5995 times)
e-tip
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 10
UIScrollview scroll offset
«
on:
May 06, 2015, 10:53:33 AM »
Hi everyone.
I've got a UIScrollview and in that scrollview i want to implement a pull to refresh function.
i've added the onDragStart and onDragFinish Event to my script but i can't find a way to calculate/obtain the offset when the user ends to drag. Does anyone have any suggestions ?
my goal is to introduce a threshold so reload function is called only when the offset is bigger than threshold
thanks in advance
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: UIScrollview scroll offset
«
Reply #1 on:
May 07, 2015, 06:49:56 PM »
Have a look at UIPanel.CalculateConstrainOffset function. It does exactly what you're looking for.
Logged
e-tip
Newbie
Thank You
-Given: 1
-Receive: 0
Posts: 10
Re: UIScrollview scroll offset
«
Reply #2 on:
May 13, 2015, 05:50:40 AM »
Wow... Thanks
Logged
Aastha
Newbie
Thank You
-Given: 2
-Receive: 0
Posts: 18
Re: UIScrollview scroll offset
«
Reply #3 on:
May 19, 2015, 11:58:32 PM »
Hi,
Can you explain this further how this function can be used to implement pull to refresh.
Thanks in Advance.
Logged
ArenMook
Administrator
Hero Member
Thank You
-Given: 337
-Receive: 1171
Posts: 22,128
Toronto, Canada
Re: UIScrollview scroll offset
«
Reply #4 on:
May 22, 2015, 03:50:10 PM »
That function will give you (0, 0) if you are observing your panel normally, and something other than 0 if you have scrolled outside the bounds. Just try using it.
Logged
Print
Pages: [
1
]
« previous
next »
Tasharen Entertainment Forum
»
Support
»
NGUI 3 Support
»
UIScrollview scroll offset