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

Lakhtin_V

Active Member
Licensed User
Longtime 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

Expert
Licensed User
Longtime User
Are you using xCustomListView ? ...
B4X:
clv1.ScrollToItem(Index)


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

Lakhtin_V

Active Member
Licensed User
Longtime 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
 
Upvote 0

Star-Dust

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