In order to move the selected textfield up and out of the way of the keypad, I need to extract its distance from the top of the screen.
I've adapted the following code found elsewhere in the forum, but it seems to return the distance (V.top) to the top of the sub-panel containing the textfield instead of the top of the main panel (pnl_Main.Top).
Is there a way to get distances referred to the top of the screen, or at least to the top of the main "mother" panel containing all the graphic elements?
I've adapted the following code found elsewhere in the forum, but it seems to return the distance (V.top) to the top of the sub-panel containing the textfield instead of the top of the main panel (pnl_Main.Top).
Is there a way to get distances referred to the top of the screen, or at least to the top of the main "mother" panel containing all the graphic elements?
B4X:
Sub Page2_KeyboardStateChanged (Height As Float)
If Height = 0 Then
pnl_Main.Top = 20
Else
For Each V As View In pnl_Main.GetAllViewsRecursive
If IsFirstResponder(V) Then
Log(V.Top)
End If
Next
End If
End Sub