Page 1 of 1

Can't set the vscroll of a native scroller

Posted: Thu Jan 23, 2014 4:50 pm
by giovanni_c
Hi all!
I'm here to ask a little question.
I'm using a native scroller for a group in a card of the stack.
After the creation of the scroller I set the "vscroll" property of the scroller to the formattedHeight of the group to scroll because I want to initialize my group starting from its bottom.
My code sound like this:

Code: Select all

put the rect of myGroup into tRect
put 0 into item 2 of tRect
put formattedHeight of myGroup into item 4 of tRect
               
mobileControlSet "scroller_notizia", "rect", the rect of myGroup
mobileControlSet "scroller_notizia", "contentRect", tRect
mobileControlSet "scroller_notizia", "visible", "true"
mobileControlSet "scroller_notizia", "hscroll", 0
mobileControlSet "scroller_notizia", "vscroll", item 4 of tRect
mobileControlSet "scroller_notizia", "canBounce", "true"
mobileControlSet "scroller_notizia", "pagingEnabled", "false"
mobileControlSet "scroller_notizia", "canScrollToTop", "true"
This works correctly under iOS but not in Android in which the "vscroll" setting is ignored. My scroller always starts from top.
There's something wrong in my script or is a bug in the engine?!
Thank you very much for your replies!

Re: Can't set the vscroll of a native scroller

Posted: Fri Jan 24, 2014 12:24 pm
by splash21
Here's what I get in the android simulator;

If I scroll the list to the top by swiping and letting the list scroll up to the top, then the next time I try to set the vscroll, I receive a scrollerDidScroll message with a value of 0. The same happens if I swipe and let the list scroll to the bottom until it stops. The next time I try to set the vscroll, I get a scrollerDidScroll message sent with the maximum vscroll value.

If I move the list by touching and keeping my finger on it, then letting go - everything seems to work fine (even moving to vscroll 0). It only gives the wrong result if the list is allowed to scroll freely after a swipe and it hit's either the start or end bound.

Looks like you've found a bug - have you filed it in the QCC?

Re: Can't set the vscroll of a native scroller

Posted: Sat Jan 25, 2014 10:43 am
by giovanni_c
Hi Splash, thank you for your reply.
I've not filed this on the QCC because I was not sure if this behavior was related to a mistake of mine.
But after your reply I'll go to add a new report to the QCC. Thank you!

Re: Can't set the vscroll of a native scroller

Posted: Sat Jan 25, 2014 4:19 pm
by giovanni_c

Re: Can't set the vscroll of a native scroller

Posted: Sun Sep 20, 2015 6:59 pm
by billhemsley
This bug, which has not yet been fixed, applies to the hscroll as well (I've added this on QCC).

I'm trying to start horizontal scrolling in the centre of a set of items.

Does anyone know of a workaround?

Re: Can't set the vscroll of a native scroller

Posted: Wed Sep 23, 2015 11:27 am
by MaxV
On Android you must add to Vscroll the distance of the top of the scroller from the top of the screen.

Re: Can't set the vscroll of a native scroller

Posted: Wed Sep 23, 2015 6:00 pm
by jacque
I usually set the scroll of the group to 0 before creating the native scroller to make sure everything aligns right. If you do that, does the bug still happen?

Also, the rect of the scroller should be the same size as the group. Is there a reason to make it start higher up?