Android Question CustomListView Item Resize Problem (Solved)

Discussion in 'Android Questions' started by walterf25, Jan 4, 2019.

  1. walterf25

    walterf25 Well-Known Member Licensed User

    Hi all, i am currently using the CustomListview.bas module version 1.66 and i can't figure out why i am seeing a bigger space between the first item and the second item in the ListView and then the space between between the items after the second item look the same, attached is my code and also an image of the issue i am seeing, can anyone tell me why that is?

    Code:
    Sub BuildItems(params As List)
        
    If imagelist.Size = 0 Then Return
        clv.Clear
        
    Dim m As Map
        m.Initialize
        
    Dim i As Int = 0
        
    For Each link As String In imagelist
            
    ''Dim su As StringUtils
            Dim p As Panel
            p.Initialize(
    "")
            
    ''Dim pp As Panel
            Dim split() As String
            
    If params.get(i) <> "" Then
            split = 
    Regex.Split("~", params.Get(i))
            clv.add(p, link & 
    "~" & split(0) & "~" & split(1))
            p.LoadLayout(
    "coaches")
            pnlmain.Color = 
    Colors.RGB(174209234)
            lbltitle.Text = split(
    0)
            lbldescription.Text = split(
    1)
            SetEllipsize(lbldescription, 
    "END")
            clv.DefaultTextBackgroundColor = 
    Colors.RGB(174209234)
            m.Put(imgcoach, link)
            clv.ResizeItem(i, 
    130dip)
            i = i + 
    1
            
    End If
        
    Next
        i = 
    0
        CallSubDelayed2(ImageDownloader, 
    "Download", m)
    End Sub
    And here is the image of the issue so you can get a better idea of what it is i'am talking about.
    space_issue.jpg
    As you can see the space between the First Item and the Second Item is more than the spacing between the second and third items.
    I'm sure is something fairly easy but i just can't point my finger on it, any ideas, suggestions?

    Thanks All,
    Walter
     
  2. walterf25

    walterf25 Well-Known Member Licensed User

    Solved it, the problem was that I had to give the panel it's dimensions right after initializing it.

    Code:
    Dim p As Panel
    p.Initialize(
    "")
    p.SetLayoutAnimated(
    000100%x120dip)
    Walter
     
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