iOS Question View over the keyboard

Alexander Stolte

Expert
Licensed User
Longtime User
Hello,

i did a tutorial on how to place a view over the keyboard on android.

But now i'm on IOS, i have search in the Forum here, but I did not find anything that helped me.

I found this Function: "CalcRelativeKeyboardHeight".

This do not work:
B4X:
pnl_ground.Top = pnl_ground.CalcRelativeKeyboardHeight(Height)

How can i calculate the top value, so i can place my view over the keyboard?

i try this too:
B4X:
pnl_ground.Top = Height - pnl_ground.Height
 

Alexander Stolte

Expert
Licensed User
Longtime User
I think i got it. But it is not 100% clean i think. This code move the panel bottom to the top of the Keyboard
B4X:
Dim ff As Int = pnl_ground.CalcRelativeKeyboardHeight(Height)
        Dim ff2 As Int = Page1.RootPanel.Height -  pnl_ground.Top
      
        pnl_ground.Top = ff2 - ff +135dip
 
Upvote 0

Alexander Stolte

Expert
Licensed User
Longtime User
Better Solution and the ultimate Solution:
B4X:
Sub page_KeyboardStateChanged (Height As Float)

Dim tmp_value as float = page.RootPanel.Height -Height
mypanel.Top = newrootheight - mypanel.Height

End Sub
 
Upvote 0
Top