Just had a question about how the correct method would be to modify a value of a view inside of the card panel after it has been created. Would you have to delete all the cards and recreate them? Or can you modify it passively? The link to the example project is above. Love this example just trying to figure out how to incorporate it into my app. Thanks in advance.
The cards are layouts like any other layouts too. A card hold all objects from the layout loaded to this Card.
See how customlistview is working.
Basically the views are children of the base panel.
@DonManfred I understand about the card being a placeholder for the views inside the panel, but am unsure how to access each individual view inside of it. Ie . Being able to change label1.text vaule. I tried changing to value of the declared view and it simply changes just the last card added.
This will work with the CardList Example project ...
B4X:
Sub lblAction1_Click
Dim index As Int = CLV1.GetItemFromView(Sender)
Dim pnl1 As B4XView = CLV1.GetPanel(index) 'base panel
Dim pnl2 As B4XView = pnl1.GetView(0) 'Card1 layout panel
pnl2.GetView(3).Text = "This Item Title has been edited ! ... " 'view(3) = 4th label on panel... refer order in Designer ViewTree for Card1 layout
'long way
Dim img As B4XView = pnl2.GetView(2)
img.SetBitmap(xui.LoadBitmapResize(File.DirAssets, "pexels-photo-446811.jpeg", ImageView1.Width, ImageView1.Height, True))
End Sub
This will work with the CardList Example project ...
B4X:
Sub lblAction1_Click
Dim index As Int = CLV1.GetItemFromView(Sender)
Dim pnl1 As B4XView = CLV1.GetPanel(index) 'base panel
Dim pnl2 As B4XView = pnl1.GetView(0) 'Card1 layout panel
pnl2.GetView(3).Text = "This Item Title has been edited ! ... " 'view(3) = 4th label on panel... refer order in Designer ViewTree for Card1 layout
'long way
Dim img As B4XView = pnl2.GetView(2)
img.SetBitmap(xui.LoadBitmapResize(File.DirAssets, "pexels-photo-446811.jpeg", ImageView1.Width, ImageView1.Height, True))
End Sub
Thank you! I wasn't understanding how to access the views , and your example makes sense now. I didnt realize that it was the order in the designer! Thanks again appreciate it!