How can I get a CustomView from the DesignerArgs? Here I read, that it is in the .Tag of B4XView. But the code below does not work (java.lang.RuntimeException: Field: ba not found in: android.widget.TextView)
B4X:
'Parameters: PrimaryColorID, SecondaryColorID, View(s)
Private Sub SetSwiftbuttonColor(DesignerArgs As DesignerArgs)
If DesignerArgs.FirstRun Then
Dim iPrimary As Int = GetColor(DesignerArgs.Arguments.Get(0))
Dim iSecondary As Int = GetColor(DesignerArgs.Arguments.Get(1))
For i = 2 To DesignerArgs.Arguments.Size - 1
Dim v As B4XView = DesignerArgs.GetViewFromArgs(i)
Dim sbtn As SwiftButton = v.Tag 'tag empty?
sbtn.SetColors(iPrimary, iSecondary)
Next
End If
End Sub
'in DesignedScript:
MyDDD.SetSwiftbuttonColor(4, 5, SwiftButton1)