Scroller bug!?
Posted: Tue May 14, 2013 10:44 am
Hi there,
I add a scroller to my App and it seems to work fine until I start scrolling
I can't scroll to end and if I try to return to the first line of text - I can't. The scroller want get back to start.
I add a scroller to my App and it seems to work fine until I start scrolling

I can't scroll to end and if I try to return to the first line of text - I can't. The scroller want get back to start.
Code: Select all
//----------
//Scrollhandler
//----------
local sScrollerID
on preOpenCard
local tScrollerRect, tContentRect
// Only create a scroller on a mobile device
if environment() is not "mobile" then exit preOpenCard
// Set the area of the scroller
put the rect of group "scrollArea" into tScrollerRect
// Set the are of the content to be scrolled
put the left of field "scrollText",the top of field "scrollText",the right of field "scrollText",the formattedHeight of field "scrollText" into tContentRect
// Create the scroller control
mobileControlCreate "scroller", "Scroll"
put the result into sScrollerID
// Set the properties of the scroller
mobileControlSet "Scroll", "rect", tScrollerRect
mobileControlSet "Scroll", "contentRect", tContentRect
mobileControlSet "Scroll", "visible", true
mobileControlSet "Scroll", "scrollingEnabled", true
mobileControlSet "Scroll", "vIndicator", false
mobileControlSet "Scroll", "hIndicator", false
mobileControlSet "Scroll", "vscroll", 0
end preOpenCard
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 "scrollArea" to vOffset
end scrollerDidScroll