I have a CustomListView with 20 items. Each item was made by loading the same Layout. The Layout is a pane that contains panes, and labels. In this moment also the text of the label was added.
Now I want to change the textcolor of the label StudioSpurItem of item X. How can I do this?
So the questions is: How to iterate through the views of a CustomListView. At the moment each attempt ends with a casting problem:
Now I want to change the textcolor of the label StudioSpurItem of item X. How can I do this?
B4X:
Sub Process_Globals
Private StudioSpurItem, Dragger As B4XView
Private UpLbl, DownLbl, OpenLbl, MetroLbl, Muell As Label
...
Sub AppStart (Form1 As Form, Args() As String)
mCLV.Initialize("")
For i = 0 To 20
Dim pnl As B4XView = CreateItem("Zeile" & i)
mCLV.Add(pnl,i)
Next
...
Sub CreateItem(Title As String) As B4XView
Dim p As B4XView = xui.CreatePanel("")
p.LoadLayout("Item")
p.SetLayoutAnimated(0, 0, 0, p.Width, p.Height)
StudioSpurItem.Text = Title
Return p
End Sub
So the questions is: How to iterate through the views of a CustomListView. At the moment each attempt ends with a casting problem:
B4X:
Sub Search(index As Int)
Dim pnl As B4XView = mCLV.GetPanel(index).Parent
'For Each v As B4XView In pnl.GetAllViewsRecursive
For Each v As Label In pnl.GetAllViewsRecursive
Log("iterate=" & v.text)
Next
End Sub