Sticky Scroller

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
SteveHanlan
Posts: 80
Joined: Fri Jul 09, 2010 6:28 pm

Sticky Scroller

Post by SteveHanlan » Mon Aug 08, 2011 7:31 am

John - I am posting here the problem I sent you in case anyone has a similar problem and/or a workaround.

I have a native iOS scroller. and within its group I have a single column dataGrid form (not table)
It scrolls perfectly until ...

If I add to, or delete from, my data and rebuild the dataGrid, I get the following.

If the 1st item in the dataGrid was visible, all is ok
If it was not visible, then the scroller shows a bunch of blank lines at the top of the datagrid and will only 'bounce' into view the same number at the bottom of the list!

I have checked the location of the dataGrid and the scroller group, and the 'top' is always the same

Anyone else seeing a similar problem?

many thanks for your time

Steve Hanlan
http://www.fundamentalapps.com

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: Sticky Scroller

Post by splash21 » Mon Aug 08, 2011 10:24 am

Hi, Steve - Does the datagrid change size, or is there a wrapper group around the data grid that is not locked as it is rebuilt? It sounds like the scroller just needs updated for it's new contents. Check out http://forums.runrev.com/viewtopic.php?f=54&t=8419 for an example of a scroller with dynamically changing contents.

Hopefully this will solve the problem.

John.
LiveCode Development & Training : http://splash21.com

SteveHanlan
Posts: 80
Joined: Fri Jul 09, 2010 6:28 pm

Re: Sticky Scroller

Post by SteveHanlan » Mon Aug 08, 2011 8:46 pm

John

I looked at your example and pulled out this line

set the top of fld "RandomData" of group "Scroller1" to the top of group "Scroller1" - the vScroll of group "Scroller1"

I did not realize that I had to adjust for the vScroll, so when I changed the data with a vScroll set it moved it by that amount

Adding that to the end of my code made everything work ok.

One note of reference. You have to do the scrollerUpdate before adjusting the top. If not it resets the top incorrectly

Cheers

Steve

Post Reply

Return to “MobGUI”