Mattiaf Active Member Licensed User Nov 24, 2022 #1 is there a way to move buttons positions at runtime just a bit above of the keyboard when typing on a edit text? thanks
is there a way to move buttons positions at runtime just a bit above of the keyboard when typing on a edit text? thanks
LucaMs Expert Licensed User Longtime User Nov 25, 2022 #2 Use the IME library. Declare a class-level (Class_Globals) variable of type IME and use the HeightChanged event: B4X: Copy Private IME1 As IME B4X: Copy Private Sub IME1_HeightChanged (NewHeight As Int, OldHeight As Int) If NewHeight = 0 Then Return ' If useful Button1.Top = NewHeight - Button1.Height End Sub Last edited: Nov 25, 2022 Upvote 1
Use the IME library. Declare a class-level (Class_Globals) variable of type IME and use the HeightChanged event: B4X: Copy Private IME1 As IME B4X: Copy Private Sub IME1_HeightChanged (NewHeight As Int, OldHeight As Int) If NewHeight = 0 Then Return ' If useful Button1.Top = NewHeight - Button1.Height End Sub
Mattiaf Active Member Licensed User Nov 25, 2022 #3 hmm it doesn't seems to work or maybe i'm doing something wrong... I'm clicking into an edit text, the keyboard appears, but the button is not relocating above the keyboard.. Upvote 0
hmm it doesn't seems to work or maybe i'm doing something wrong... I'm clicking into an edit text, the keyboard appears, but the button is not relocating above the keyboard..
LucaMs Expert Licensed User Longtime User Nov 26, 2022 #4 Mattiaf said: hmm it doesn't seems to work or maybe i'm doing something wrong... I'm clicking into an edit text, the keyboard appears, but the button is not relocating above the keyboard.. Click to expand... Try the example attached to the official thread about IME: https://www.b4x.com/android/forum/t...-keyboard-with-the-ime-library.14832/#content You will see that the btnHideKeyboard button is moved above the keyboard in the IME_HeightChanged event, just like I suggested. This won't work if you set the Activity to full screen, due to an Android bug that was never fixed! Upvote 0
Mattiaf said: hmm it doesn't seems to work or maybe i'm doing something wrong... I'm clicking into an edit text, the keyboard appears, but the button is not relocating above the keyboard.. Click to expand... Try the example attached to the official thread about IME: https://www.b4x.com/android/forum/t...-keyboard-with-the-ime-library.14832/#content You will see that the btnHideKeyboard button is moved above the keyboard in the IME_HeightChanged event, just like I suggested. This won't work if you set the Activity to full screen, due to an Android bug that was never fixed!