Sub GetRealPageSize(Page1 As Page) As Rect
Try
Dim rect2 As Rect
Dim height,width As Float
Dim no As NativeObject = Page1.RootPanel
Dim top = 0, left = 0 As Int
height = Page1.RootPanel.Height
width = Page1.RootPanel.Width
no = no.GetField("safeAreaInsets")
Dim matcher As Matcher = Regex.Matcher("\{(.*)\}", no.AsString.Replace(" ", ""))
If matcher.Find Then
Dim values() As String = Regex.Split(",", matcher.Group(1))
top = top + values(0)
left = left + values(1)
height = height - values(2) - top
width = width - values(3) - left
End If
rect2.Initialize(left,top,width,height)
If rect2.Bottom = 0 And rect2.Top = 0 And rect2.Left = 0 And rect2.Right = 0 Then
rect2.Initialize(0,0,GetDeviceLayoutValues.Width,GetDeviceLayoutValues.Height)
End If
Return rect2
Catch
Dim rect2 As Rect
rect2.Initialize(0,0,Page1.RootPanel.Width,Page1.RootPanel.Height)
Return rect2
End Try
End Sub