...
For i = 1 To 20
clv2.Add(CreateListItem($"Item #${i}"$, clv2.AsView.Width, 60dip), $"Item #${i}"$)
Next
...
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Width, Height)
p.LoadLayout("CellItem") '<----- HERE YOU LOAD YOUR LAYOUT
Label1.Text = Text
Return p
End Sub
...
For i = 1 To 20
clv2.Add(CreateListItem($"Item #${i}"$, clv2.AsView.Width, 60dip), $"Item #${i}"$)
Next
...
Sub CreateListItem(Text As String, Width As Int, Height As Int) As Panel
Dim p As B4XView = xui.CreatePanel("")
p.SetLayoutAnimated(0, 0, 0, Width, Height)
p.LoadLayout("CellItem") '<----- HERE YOU LOAD YOUR LAYOUT
Label1.Text = Text
Return p
End Sub