I would like to replace the standard scroller of the data grid in a standalone for Android with the native scrolling (by swipping).
On the card level I have this code:
Code: Select all
on openCard
local tScrollerRect, tContentRect
// Only create a scroller on a mobile device
if environment() is not "mobile" then exit openCard
// Set the area of the scroller
put the rect of group "DataGrid 1" into tScrollerRect
// Set the area of the content to be scrolled
put 0,0,(the formattedWidth of group "DataGrid 1"),(the formattedHeight of group "DataGrid 1") into tContentRect
// Create the scroller control
mobileControlCreate "scroller", "loremScroll"
put the result into sScrollerID
// Set the properties of the scroller
mobileControlSet "loremScroll", "rect", tScrollerRect
mobileControlSet "loremScroll", "contentRect", tContentRect
mobileControlSet "loremScroll", "visible", true
mobileControlSet "loremScroll", "scrollingEnabled", true
mobileControlSet "loremScroll", "vIndicator", true
mobileControlSet "loremScroll", "vscroll", 0
end openCard
on closeCard
// Delete the scroller
if environment() is not "mobile" then exit closeCard
mobileControlDelete sScrollerID
end closeCard
on scrollerDidScroll hOffset, vOffset
// When the user scrolls move the displayed content
set the vScroll of group "DataGrid 1" to vOffset
end scrollerDidScroll
The stack is attached.
Any ideas how to correct the code? Thanks.
keram