Android Question how to move the custom list (ScrollView) to the desired position

Lakhtin_V

Member
Licensed User
I use a custom list (ScrollView) created from panels. How can I transfer focus to the desired record in the list. I know the line number, but I do not know how to move the list to the desired position.
 

mangojack

Well-Known Member
Licensed User
Are you using xCustomListView ? ...
B4X:
clv1.ScrollToItem(Index)

If you have created your own using ScrollView it would be ...
B4X:
ScrollView1.ScrollToNow(index)
 

Lakhtin_V

Member
Licensed User
I unfortunately use the usual list, not XcustomList
The RequestFocus remembers the position on the screen measured in pixels, it does not fit to move along the records

Public scvMain As ScrollView

upload_2019-6-2_10-54-11.png
 

Star-Dust

Expert
Licensed User
use ScrollPosition. you have to calculate the position based on the position multiplied by the height of each item
 
Top