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

Discussion in 'Android Questions' started by Lakhtin_V, Jun 1, 2019.

  1. Lakhtin_V

    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.
     
  2. mangojack

    mangojack Well-Known Member Licensed User

    Are you using xCustomListView ? ...
    Code:
    clv1.ScrollToItem(Index)

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

    Erel Administrator Staff Member Licensed User

    Use xCustomListView.
     
  4. Lakhtin_V

    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
     
  5. Star-Dust

    Star-Dust Expert Licensed User

    use ScrollPosition. you have to calculate the position based on the position multiplied by the height of each item
     
    Lakhtin_V likes this.
  6. Lakhtin_V

    Lakhtin_V Member Licensed User

    Good idea! thank
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice