B4J Question Horizontal CustomListView

LucaMs

Expert
Licensed User
Longtime User
I can't set the height of the items as I would like (the bottom border is not visible. Test project attached).




B4X:
Private Sub FillCLV
    For i = 0 To 10
        CustomListView1.Add(CreateItem(i), i)
    Next
End Sub

Private Sub CreateItem(Index As Int) As B4XView
   
    Dim ItemHeightDiff As Int = 20dip ' Changes nothing!  <-----------------
   
    Dim pnlItem As B4XView
    pnlItem = xui.CreatePanel("")
'    pnlItem.SetLayoutAnimated(0, 0, 0, 60dip, CustomListView1.GetBase.Height)
    pnlItem.SetLayoutAnimated(0, 0, 0, 50dip, CustomListView1.GetBase.Height - ItemHeightDiff)  <-----------------
    pnlItem.LoadLayout("layCLVItem")
    pnlItem.SetColorAndBorder(xui.Color_Yellow, 1dip, xui.Color_Black, 0)
    Label1.Text = (Index + 1)
    Label2.Text = (Index + 1) * 10
    Label3.Text = (Index + 1) * 100
    Return pnlItem
End Sub
 

Attachments

  • HorCLV.zip
    3.4 KB · Views: 10

teddybear

Well-Known Member
Licensed User
Try setting sv.height
B4X:
CustomListView1.sv.Height=CustomListView1.GetBase.Height - 2dip
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…