Android Question View.Parent read-only

DonManfred

Expert
Licensed User
Longtime User
You are posting this wish in the wrong forum.

You can not change a Parent of a View. You need to remove the view from its parent and add it to the new parent.
Erel has posted an Example somewhere.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
You are posting this wish in the wrong forum.
I know:
Mainly a "wish".
;)

You can not change a Parent of a View.
I know this too and the reason is because Parent is read-only.

modViewsUtils - code module:
B4X:
Public Sub MoveB4XView(xView As B4XView, Destination As B4XView)
    xView.RemoveViewFromParent
    Destination.AddView(xView, xView.Left, xView.Top, xView.Width, xView.Height)
End Sub

B4X:
Public Sub MoveB4XView2(xView As B4XView, Destination As B4XView, Left As Int, Top As Int, Width As Int, Height As Int)
    xView.RemoveViewFromParent
    Destination.AddView(xView, Left, Top, Width, Height)
End Sub
 
Last edited:
Upvote 0
Top