D
Deleted member 103
Guest
Hi,
I have to find the Rootpanel from my own CustomView.
This is my solution that works in my case.
The question is whether it works everywhere and if not, if there may be a better solution?
I have to find the Rootpanel from my own CustomView.
This is my solution that works in my case.
The question is whether it works everywhere and if not, if there may be a better solution?
B4X:
Public Sub DesignerCreateView (Base As Panel, lbl As Label, Props As Map)
mBase.Value = Base
...
myRootPanel = getRootPanel(Base)
myRootPanel.AddView(pnlBackground, 0, 0, myRootPanel.Width, myRootPanel.Height)
...
End Sub
Private Sub getRootPanel(Base As Panel) As View
Dim v As View = Base.Parent
Do While v.Width > 0
v = v.Parent
Loop
Return v
End Sub