J javiers Active Member Licensed User Longtime User May 9, 2024 #1 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!
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!
Sagenut Expert Licensed User Longtime User May 9, 2024 #2 https://www.b4x.com/android/forum/t...ew-here-s-how-to-add-programmatically.118037/ Upvote 0
J javiers Active Member Licensed User Longtime User May 9, 2024 #3 Sagenut said: https://www.b4x.com/android/forum/t...ew-here-s-how-to-add-programmatically.118037/ Click to expand... 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 Code: Copy 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 said: https://www.b4x.com/android/forum/t...ew-here-s-how-to-add-programmatically.118037/ Click to expand... 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 Code: Copy 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
Sagenut Expert Licensed User Longtime User May 9, 2024 #4 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
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.