please, test this project
i put 5 B4XFloatTextField into Pane from code, and is OK
but resizing form, last B4XFloatTextField split at top
am I wrong or..?
It is usual to load the layout with a customview into a panel, then place the panel onto the target pane:
B4X:
For i = 1 To 5
Dim P As B4XView = xui.CreatePanel("")
P.SetLayoutAnimated(0,0,0,240,50)
P.LoadLayout("casella3")
Pane1.AddNode(P,300,i*52,240,50)
B4XFloatTextField1.Text = $"i am ${i+5} TextField"$
Next
Your version does work if you disable Handle resize event in the layout. Although if the Customview has to respond to resizing (you use height or width anchors in the designer), you would then have to manage that yourself.
It is usual to load the layout with a customview into a panel, then place the panel onto the target pane:
B4X:
For i = 1 To 5
Dim P As B4XView = xui.CreatePanel("")
P.SetLayoutAnimated(0,0,0,240,50)
P.LoadLayout("casella3")
Pane1.AddNode(P,300,i*52,240,50)
B4XFloatTextField1.Text = $"i am ${i+5} TextField"$
Next
Your version does work if you disable Handle resize event in the layout. Although if the Customview has to respond to resizing (you use height or width anchors in the designer), you would then have to manage that yourself.
now, into Pane1 there are five B4XFloatTextField and question is:
how to remove only the third element ?
TextField 1
TextField 2
Empty
TextField 4
TextField 5
For i=1 To 5
Dim P As B4XView = xui.CreatePanel("")
P.SetLayoutAnimated(0,0,0,240,50)
P.LoadLayout("casella2")
Pane1.AddNode(P,10,i*52,240,50)
B4XFloatTextField1.Text = $"i am ${i} TextField"$
B4XFloatTextField1.mBase.Tag = $"#|${i}"$ 'Tag Element
Next
and remove
B4X:
For Each txt As B4XView In Pane1.GetAllViewsRecursive
If txt.Tag = "#|3" Then
txt.RemoveViewFromParent
End If
Next