Android Question AS-Chips [B4X] Add programmatically to a panel?

javiers

Active Member
Licensed User
Longtime User
I would like to add AS-Chips to a panel that I create programmatically in B4J. Is this possible to do?

Thanks for the reply!
 

javiers

Active Member
Licensed User
Longtime User
Thanks for the answer, but I don't think it helps me. I understand that you have to load a layout containing the AS_Chip1 view.
I will do it using label or buttons, which allow me to do something
B4X:
For i = 0 To NbButtons - 1
 Dim btn As Button
 btn.Initialize("Button")
 btn.text = i + 1
 btn.Tag = i + 1
 fp.Panel.AddView(btn, x, y, Width, Height)
x = x + DeltaX
 If x > 350 Then
x = 0
 y = y + DeltaY
 End If
 
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Unluckily that is the only way to add CustomViews by code.
You need to prepare a layout with only the CV (in your case the AS_Chip) and then load it on every panel that you will create.
All the CV will have the same name and will raise the same Event with the same Event Name.
In there you will need to manage them creating a reference with the Sender.
 
Upvote 0
Top