Hi
I have a panel for show product
I can detect count of panel in each row
Example for 4 inch device,i must add 2 panel
I can add panel(product) and each row successfully
but i want to use CustomListView in my app for speed up app
How can i add many panel in each row when i using CLV?
You should create Items to add to a CLV; each Item is a panel, which can contain how many views you want of any type (then also two or more panels):
Something like:
B4X:
Private clv As CustomListView
Dim PanelItemHeight...
For i = 0 To 9
clv.Add(CreateItem, PanelItemHeight, "Item" & i)
Next
Private Sub CreateItem As Panel
Dim pnlItem As Panel
...
Dim pnl1, pnl2, pnl3...
...
pnlItem.AddView(pnl1,...)
pnlItem.AddView(pnl2,...)
...
Return pnlItem
End Sub
You can also create items' layouts by Designer and load them into items (the layout can contain two or more panels, of course)
B4X:
For i = 0 To 9
Dim pnlItem As Panel
pnlItem.Initialize...
pnlItem.LoadLayout(...)
clv.Add(pnlItem, PanelItemHeight, "Item" & i)
Next
You should create Items to add to a CLV; each Item is a panel, which can contain how many views you want of any type (then also two or more panels):
Something like:
B4X:
Private clv As CustomListView
Dim PanelItemHeight...
For i = 0 To 9
clv.Add(CreateItem, PanelItemHeight, "Item" & i)
Next
Private Sub CreateItem As Panel
Dim pnlItem As Panel
...
Dim pnl1, pnl2, pnl3...
...
pnlItem.AddView(pnl1,...)
pnlItem.AddView(pnl2,...)
...
Return pnlItem
End Sub
You can also create items' layouts by Designer and load them into items (the layout can contain two or more panels, of course)
B4X:
For i = 0 To 9
Dim pnlItem As Panel
pnlItem.Initialize...
pnlItem.LoadLayout(...)
clv.Add(pnlItem, PanelItemHeight, "Item" & i)
Next