I'm trying to get an area of my screen on Android to scroll, preferably without a vertical scrolbar (which works, but it's not very pretty). I've tried to follow this lesson:
http://lessons.runrev.com/m/4069/l/9441 ... ll-a-field
In my case, I've got a few different types of fields, buttons, text fields and, most importantly, a native browser control. This browser is contained in a group by itself and the objects I want to scroll are also grouped. The encompassing group has been resized to be smaller thant the total contents, so that about half the browser shows up. The idea is that you can see all of the browser by scrolling. Strangely enough, I never get any scrollerDidScroll events, so nothing ever happens. When the browser is activated, the contents is sized to fit the VISIBLE part, rather than stretch below into the part that's hidden from view (and where you'd scroll to to see it).
I tried putting the code in openCard as well but that doesn't make any difference and the values displayed are the same.
What am I missing folks?
Here's the code:
Code: Select all
local sScrollerID on preOpenCard ..... put the rect of group "ScrollRescue" into tScrollerRect put 0,0,(the formattedWidth of group "ScrollRescue"),(the formattedHeight of group "ScrollRescue") into tContentRect mobileControlCreate "scroller", "ScrollerRescue" put the result into sScrollerID # This says: Scroller: 14,96,350,598 Content: 0,0,353,658 ID: 4 answer "Scroller: " & tScrollerRect && "Content: " & tContentRect && "ID: " & sScrollerID mobileControlSet "ScrollerRescue", "rect", tScrollerRect mobileControlSet "ScrollerRescue", "contentRect", tContentRect mobileControlSet "ScrollerRescue", "visible", true mobileControlSet "ScrollerRescue", "scrollingEnabled", true mobileControlSet "ScrollerRescue", "vIndicator", true mobileControlSet "ScrollerRescue", "vscroll", 0 end preOpenCard on scrollerDidScroll hOffset, vOffset // When the user scrolls move the displayed content answer "Scroller H: " & hOffset && "V " & vOffset # this dialogue never appears set the vScroll of group "ScrollRescue" to vOffset end scrollerDidScroll on closeCard ..... mobileControlDelete sScrollerID end closeCard