Alexander Stolte Expert Licensed User Longtime User May 21, 2018 #1 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: Code: Copy 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: Code: Copy pnl_ground.Top = Height - pnl_ground.Height
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: Code: Copy 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: Code: Copy pnl_ground.Top = Height - pnl_ground.Height
Erel B4X founder Staff member Licensed User Longtime User May 22, 2018 #2 Start with the simplest approach: https://www.b4x.com/android/forum/threads/input-accessory-views.51000/#content Upvote 0
Start with the simplest approach: https://www.b4x.com/android/forum/threads/input-accessory-views.51000/#content
Alexander Stolte Expert Licensed User Longtime User May 22, 2018 #3 Erel said: Start with the simplest approach Click to expand... is there no way to calculate this with the "CalcRelativeKeyboardHeight" function? Upvote 0
Erel said: Start with the simplest approach Click to expand... is there no way to calculate this with the "CalcRelativeKeyboardHeight" function?
Erel B4X founder Staff member Licensed User Longtime User May 23, 2018 #4 There is. You can see how to use it here: https://www.b4x.com/android/forum/threads/calcrelativekeyboardheight-example.64054/ Upvote 0
There is. You can see how to use it here: https://www.b4x.com/android/forum/threads/calcrelativekeyboardheight-example.64054/
Alexander Stolte Expert Licensed User Longtime User May 23, 2018 #5 Erel said: There is Click to expand... 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 Code: Copy 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
Erel said: There is Click to expand... 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 Code: Copy Dim ff As Int = pnl_ground.CalcRelativeKeyboardHeight(Height) Dim ff2 As Int = Page1.RootPanel.Height - pnl_ground.Top pnl_ground.Top = ff2 - ff +135dip
Alexander Stolte Expert Licensed User Longtime User Jun 3, 2018 #6 Better Solution and the ultimate Solution: Code: Copy Sub page_KeyboardStateChanged (Height As Float) Dim tmp_value as float = page.RootPanel.Height -Height mypanel.Top = newrootheight - mypanel.Height End Sub Upvote 0
Better Solution and the ultimate Solution: Code: Copy Sub page_KeyboardStateChanged (Height As Float) Dim tmp_value as float = page.RootPanel.Height -Height mypanel.Top = newrootheight - mypanel.Height End Sub