Android Question Forcing scroll in a ScrollView

GiovanniPolese

Well-Known Member
Licensed User
Longtime User
I am facing the problem of dynamically scrolling a ScrollView. The problem arises (of course) when the ScrollView is not completely contained in the available space (in this case the ScrollView is defined with the Designer and is part of a layout). I tried the following:

' RowHeight is a constant

number_of_rows=number_of_rows+1 ' increment number of rows

ScrollView.Panel.Height=RowHeight*number_of_rows ' update PanelHeight

ScrollView.ScrollPosition=ScrollView.Panel.Height+RowHeight ' these 3 statements are just "trials"
ScrollView.ScrollToNow(ScrollView.Panel.Height+RowHeight)
ScrollView.Invalidate

The ScrollView scrolls .. but Always I cannot see the last line.. Actually what should be necessary is a "ScrollToBottom" or something like that.
Thanks in advance
 
Top