Seeking for a way to set customview properties for a number of the same customviews in a loop via code.
Example: Defined the 3 customviews
Instead of setting for each
want to loop over the customviews (with property Tag set) and set the textsize.
Each customview is a pane with properties.
Tried like below snippet but cast error (basically expected but do not know how to access the customview; note mBase is public)
Example: Defined the 3 customviews
B4X:
Private ThermostatMakeLab As xInstrumentationController
Private ThermostatWohnzimmer1 As xInstrumentationController
Private ThermostatWohnzimmer2 As xInstrumentationController
B4X:
Dim TEXTSIZE as Int = 12
ThermostatMakeLab.TextSize =TEXTSIZE
ThermostatWohnzimmer1.TextSize = TEXTSIZE
ThermostatWohnzimmer2.TextSize = TEXTSIZE
Each customview is a pane with properties.
Tried like below snippet but cast error (basically expected but do not know how to access the customview; note mBase is public)
B4X:
For Each v As B4XView In MainPage.Root.GetAllViewsRecursive
If v Is Pane and v.Tag > 0 Then
'GetView(0) is Canvas, GetView(1) is Pane
Dim ic as xInstrumentationController = v.GetView(1).As(xInstrumentationController)
ic.TextSize = TEXTSIZE
End If
Next