Bug? Customlistview, scrolltoitem problem

Discussion in 'Bugs & wishlist' started by kohle, Mar 23, 2018.

  1. kohle

    kohle Active Member Licensed User

    I have the customlistview 1.76 in serveral projects and no time to change this projects to xcust...

    scrolltoitem and jumptoitem dont work.

    For check, I downloaded the example from : https://www.b4x.com/android/forum/t...xible-list-based-on-scrollview.19567/#content

    and I made the changes to the code :

    Code:
    Sub Activity_Create(FirstTime As Boolean)
        
    Activity.LoadLayout("1")
        clv1.AddTextItem(
    "Aaaa""a")
        clv1.AddTextItem(
    "Aaaa" & CRLF & "Bbbb""b")
        clv1.AddTextItem(
    "Aaaa" & CRLF & "Bbbb" & CRLF & "Cccc""c")
        clv1.AddTextItem(
    "Aaaa" & CRLF & "Bbbb" & CRLF & "Cccc" & CRLF & "Dddd" , "d")
        clv1.AddTextItem(
    "Aaaa" & CRLF & "Bbbb" & CRLF & "Cccc" & CRLF & "Dddd" & CRLF & "Eeee""e")
        
    For i = 1 To 30
            clv2.Add(CreateListItem(
    $"Item #${i}"$, clv2.AsView.Width, 70dip), 70dip$"Item #${i}"$)
        
    Next
      
      
        clv1.JumpToItem(
    3)
        clv2.Jumptoitem(
    12)
      
      
      
        clv1.ScrollToItem(
    3)
        clv2.ScrollToItem(
    12)
      
    End Sub

    It dont work. I have b4a 8

    Edit : I checked sample of xcustom... Dont work too.
    Edit : If I put a breakpoint it works. Without breakpoint no.
     
    Last edited: Mar 23, 2018
  2. Erel

    Erel Administrator Staff Member Licensed User

    This is not a bug. ScrollView layout is not immediately ready. Try it with Sleep(100) before you try to jump.
     
  3. kohle

    kohle Active Member Licensed User

    it works, small list, , but maybe its better to include a "retrieveend event"
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    No event is raised for that. My guess that it will work with Sleep(0) as well.
     
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