Page 1 of 1
how do i get a native scroller to start from the bottom?
Posted: Sat Dec 22, 2018 3:45 pm
by Peter@multidesk.se
I try to get a native scroller to start from the bottom instead from the top.
I can set the start value with
Code: Select all
set the vScroll of group "theList" to the formattedHeight of group "theList"
but when I touch the control the scroller jumps back to the top of the list
I thought it would be enough to set the VScroll to the formattedHeight of group, but it didn't, of course!
How do I prevent this unwanted behavior?
///Peter
Re: how do i get a native scroller to start from the bottom?
Posted: Sat Dec 22, 2018 4:06 pm
by Klaus
Hi Peter,
you probably also need to set the scroll of your mobile scroller:
Code: Select all
...
put the formattedHeight of group "theList" into tVScroll
set the vScroll of group "theList" to tVScroll
mobilecontrolset "your scroller for the group here","vScroll",tVScroll
...
Out of my head, I do not own any mobile device.
Best
Klaus
Re: how do i get a native scroller to start from the bottom?
Posted: Sat Dec 22, 2018 4:42 pm
by Peter@multidesk.se
Hi Klaus,
Thanks for the suggestion, But I had already tried to set the scroll and it didn't work
///Peter
Re: how do i get a native scroller to start from the bottom?
Posted: Sun Dec 23, 2018 7:24 pm
by jacque
Usually you need to set both the native scroller and the field scroll to zero first, which will align them properly. Then set both scrolls to the position you want to display.
Setting a LC field scroll to its formattedHeight doesn't really do that. LC automatically prevents overscrolling, so the actual scroll is less than the formattedHeight. You probably need to set the native field to the scroll of the LC field, which will be the actual adjusted scroll.
Re: how do i get a native scroller to start from the bottom?
Posted: Tue Mar 12, 2019 8:57 pm
by rolandstauber
Hi Peter,
I had a similar problem (after deleting and recreating of a scroller) and found the following solution:
1. set the vScroll of your scroller to zero B E F O R E you create the native scroller !!!
2. Now create the scroller and after that use
3. scrollerDidScroll HScroll,YourDesiredVScrollValue
4. mobileControlSet YourScroller, "vscroll", YourDesiredVScrollValue
Try it.
I hope it will work.
Roland.
Re: how do i get a native scroller to start from the bottom?
Posted: Wed Mar 13, 2019 9:34 am
by Charlie Hayes
Note that this scrolls the view completely to the bottom, so the view is essentially not visible (unless you added something to it after the measurement). This makes sense since the code scrolls to the height of the scrollable area, not to the height of children overflowing the scrollable area (probably NOT what OP wanted).