Does anyone have a neat way of using a native scroller to scroll a group (containing other groups) with elements that may show or hide depending on interaction?
If I set the visibility of the items then I need to reset (destroy and recreate) the scroller, otherwise it goes haywire, even though the elements shown and hidden are the same size and location. If I recreate the scroller, the scroll location jumps to the top and the page layout skips, so the user has to scroll back to the original place. I have tried saving the current vscroll property of the scroller with mobileControlGet (tScrollerID,"vscroll") and then destroying and recreating the scroller, then using the saved value with mobileControlSet tScrollerId, "vscroll", tVscroll. For good measure I have also set the vScroll of group "ScrollingGroup" to tVscroll. It kind of works every so often, but mostly just leaves a haywire scroller working on different parts of the scrolling group.
Any advice?
Thanks
Native scrolling a group with dynamic content
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Native scrolling a group with dynamic content
I think the only choice is to do what you're doing now. A scroller is just a way of caching content in memory so that it can be moved smoothly. If the content changes then the cached version has to be updated in RAM.
Each change will require that you treat it like a new scroller. Store the current scroll of the group in a variable for later reference, then destroy the scroller, change the group content, set the group scroll to 0, create the new scroller, and finally set the scroll of both the group and the scroller to the saved variable value. Lock the screen during the process for speed and cosmetics.
It would be nice to have a way to refresh the scroller content without recreating it but I don't recall any way to do that offhand.
Each change will require that you treat it like a new scroller. Store the current scroll of the group in a variable for later reference, then destroy the scroller, change the group content, set the group scroll to 0, create the new scroller, and finally set the scroll of both the group and the scroller to the saved variable value. Lock the screen during the process for speed and cosmetics.
It would be nice to have a way to refresh the scroller content without recreating it but I don't recall any way to do that offhand.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Native scrolling a group with dynamic content
The thing is, having recreated the scroller, setting its vscroll and that of the group doesn't give reliable results. It would be nice if switching the visibility of different controls of the same rect worked, but that upsets the scroller. I have discovered this evening that switching the blendLevel from 0 to 99 and vice versa does actually seem to work.
Re: Native scrolling a group with dynamic content
That's really odd. I wouldn't have thought the blendlevel would matter. Interesting.
When I first worked through a similar issue a long time ago, I found the key was to reset the group scroll to zero before creating the scroller. But if the blendlevel trick works, maybe that's enough. It's a weird side effect though.
When I first worked through a similar issue a long time ago, I found the key was to reset the group scroll to zero before creating the scroller. But if the blendlevel trick works, maybe that's enough. It's a weird side effect though.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com