iOS Question Absolute position of view

You can use this code:
Code: Copy
Sub GetPageLeftAndTop(v As View) As Float()
   Dim tl(2) As Float
   Do While GetType(v) <> "B4IMainView"
     Dim no As NativeObject = v
     tl(0) = tl(0) + v.Left
     tl(1) = tl(1) + v.Top
     v = no.GetField("superview")
   Loop
   Return tl
End Sub

Code: Copy
Dim LeftTop() As Float = GetPageLeftAndTop(Button1)
Log($"Left: ${LeftTop(0)} Top: ${LeftTop(1)}"$)
 
Upvote 0
Back
Top