NUB's first post...
Making a scrolling text "logging" area for doing old-school logging of program activity while trying various technologies in B4A. I see scrolling text been hammered on a lot over the years, a lot of stuff with reflection, and a number of tacts that I did not fully understand. But I think I found a fairly simple solution with only one flaw that I can find.
The approach is to create a ScrollView, which is parent to a Label. Parenting established at runtime, rather than design time, because I don't see a way to do it at design time. The vertical height of text displayed in the label is computed via Canvas, and both the Label and ScrollView Panel height are grown based on that computed height. And THEN to attempt to keep the view scrolled to the bottom as new text lines are added....
That's the snag I found. There is always one text line that is scrolled out of view at the bottom. I can not seem to find any value for the ScrollPosition that reveals that last line. The user can scroll to it by dragging, but I can not seem to do it programmatically. Any clues for me?
Making a scrolling text "logging" area for doing old-school logging of program activity while trying various technologies in B4A. I see scrolling text been hammered on a lot over the years, a lot of stuff with reflection, and a number of tacts that I did not fully understand. But I think I found a fairly simple solution with only one flaw that I can find.
The approach is to create a ScrollView, which is parent to a Label. Parenting established at runtime, rather than design time, because I don't see a way to do it at design time. The vertical height of text displayed in the label is computed via Canvas, and both the Label and ScrollView Panel height are grown based on that computed height. And THEN to attempt to keep the view scrolled to the bottom as new text lines are added....
That's the snag I found. There is always one text line that is scrolled out of view at the bottom. I can not seem to find any value for the ScrollPosition that reveals that last line. The user can scroll to it by dragging, but I can not seem to do it programmatically. Any clues for me?