Hey there,
Im a bit confused, because the code I am writing does not work. I am trying to replace a view by a new view of the same type.
Here is my code:
Am I doing something wrong or is it just not possible to replace a view?
Only for understanding my problem:
- I do not want to remove the view and then add it again, because this changes the z-order.
- I do not want to just set v.Color because i want to change more fields that are defined within the Map called "vmap"
Im a bit confused, because the code I am writing does not work. I am trying to replace a view by a new view of the same type.
Here is my code:
B4X:
For Each v As View In act.GetAllViewsRecursive
If Not(v.Tag = Null) Then
vmap = v.Tag
If vmap.Get("name") = "testbutton" Then
Dim newbt as Button
newbt = CreateNewButton(vmap)
v = newbt
End If
End If
Next
Am I doing something wrong or is it just not possible to replace a view?
Only for understanding my problem:
- I do not want to remove the view and then add it again, because this changes the z-order.
- I do not want to just set v.Color because i want to change more fields that are defined within the Map called "vmap"