Private Sub Button1_Click
For i = 0 To 5
Dim wholePanel As B4XView = makePanel(50dip, 10dip)
Dim lbl As Label
lbl.initialize("")
lbl.Text = "Content " & i
wholePanel.GetView(0).addview(lbl, 0, 0, wholePanel.Width, 50dip)
wholePanel.GetView(1).SetColorAndBorder(xui.Color_Black, 0, 0, 0)
CustomListView1.Add(wholePanel, i)
Next
End Sub
Private Sub makePanel(contentHeight As Float, dividerHeight As Float) As B4XView
Dim wholePanel As B4XView = xui.CreatePanel("")
wholePanel.SetLayoutAnimated(0, 0, 0, CustomListView1.GetBase.Width, contentHeight + dividerHeight)
Dim contentPanel As B4XView = xui.CreatePanel("")
wholePanel.AddView(contentPanel, 0, 0, wholePanel.width, contentHeight)
Dim dividerPanel As B4XView = xui.CreatePanel("")
wholePanel.AddView(dividerPanel, 0, contentHeight, wholePanel.width, dividerHeight)
Return wholePanel
End Sub