Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller
- Posts: 87
- Joined: Tue Nov 13, 2007 6:40 pm
I need to be able to scroll through data in a Data Grid using the Mobile Native Control Scroller.
I've been able to get the functionality working in the attached Stack, HOWEVER, I cannot get the scroller to go to the very bottom or far right of the DataGrid on Android.
If you look a the Data Grid Scroll bar it shows that there is more data, but the native scroller will not scroll there. If you tap on the DG scroll bar it will take you to the data, but the Native Scroller will not.
Here is my code in the ScrollerDidScroll handler:
Code: Select all
on scrollerDidScroll hOffset, vOffset
if environment() is not "mobile" then exit scrollerDidScroll
if scrollID is Empty OR scrollGroupID is Empty then
logSaverError "Scrolled without valid Scroll definition: " && scrollID && scrollGroupID
-- Set the DataGrid Scroll
put vOffset + 0 into VertOffset -- Size of the Header
if VertOffset >= 0 then
set the dgVScroll of scrollGroupID to VertOffset
set the dgVScroll of scrollGroupID to 0
if hOffset >= 0 then
set the dgHScroll of scrollGroupID to hOffset
set the dgHScroll of scrollGroupID to 0
I tried to pad the vOffset value by the size of the DataGrid Header, but then you cannot get to the data that is at the top of the DataGrid.
Am I doing something wrong or is this a bug?
- Stack with DG with Native Scrolling
- (11.54 KiB) Downloaded 57 times
- Posts: 555
- Joined: Sat Sep 27, 2014 10:32 am
- Location: the Netherlands
This bug was solved in lc9.0.0DP10.
But is present in LC8.1.9 stable, i've added a comment to the bug report.
I've had an DG with and one without images on Android. The one without images scrolls perfect, the one with images did not scroll and showed only 4 items (exactly fitting into the height of the DG) although there were 6 items when testing. In IDE everything showed but on device no. But dgLines answer 6, so 2 were no shown when scrolling. Test with LC900DP11 worked OK.
Hopefully they will fix it in LC8.1.10 too.
Sony HitBit HB75P MSX-1, Amiga 500 v1.3, Amiga 600, Amiga 1200, Pentium 1 and onwards to all loose PC crap boards which already was in the Amiga for ages not mentioning the startup speed, which we now have again with SSD