Android Question ScrollView - Code Show Last Item

Discussion in 'Android Questions' started by Eduardo Funabashi, Mar 9, 2015.

  1. Eduardo Funabashi

    Eduardo Funabashi Member Licensed User

    Hello,

    How to make scrollview control to show last item inserted ?
    I have a scroll view that has 10 itens in the visible area.
    And what I want is that every each new item inserted, scrollview moves to show last item inserted
    Could you please help ?

    Regards
     
  2. klaus

    klaus Expert Licensed User

    You need to show us your code to see what you have done and how.
    You need to set the ScrollView.Panel.Height correctly.
     
  3. Eduardo Funabashi

    Eduardo Funabashi Member Licensed User

    Hello, I'm using DbUtils to fill scrollview

    Code: Sub ExecuteListView(SQL As SQL, Query As String, StringArgs() As String, Limit As Int, ListView1 As ListView, TwoLines As Boolean)

    After I execute this Sub, it fills my Listview with my data, but I would like that after fill, that scrollview points to last item inserted.
     
  4. eurojam

    eurojam Well-Known Member Licensed User

    use something like this:
    Code:
    listview1.SetSelection(listview1.Size-1)
     
  5. Eduardo Funabashi

    Eduardo Funabashi Member Licensed User

    Thank you "eurojam". That´s it.
     
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