First, it's not a simple question like this quest or this quest.
I have to get soft keyboard height in my project. I used to get device screen height and subtraction it by out app root view height. However, it work correctly until my test using keyboard suggestion. Unfortunately for me, my solution did not right in this case. The number I got alway bigger than the soft keyboard height. I tried to google but fail.
Here's my picture:
Related
I have searched and searched and there I can't find a suitable and working answer for how to get the default keyboard height on Android when you are not resizing the view.
My activity needs to have this:
android:windowSoftInputMode="adjustNothing"
So how do I know the height of the keyboard when it is displaying?
In fact there's no way to do this, and there's no 'default height' kinda value. One idea is that when showing keyboars at first time, measure your apps resized height value, and try compare this height with normal status value. Try save this value and use them.
In my AIR mobile application I am trying to resize my application when the softkeyboard is activated so that the bottom of my application will not be covered by the keyboard. From what I have read this is suppose to be the default behavior but I have never been able to get it to work and I have tried everything I have found online, instead the keyboard overlays ontop of the application.
I then decided I would resize my application myself based on the height and y position of the softkeyboard only to find out that the built in AIR methods for determining the height and y position of the keyboard are not correct (YAY). I even tried using a 3rd party ANE for determining the screen height by FreshPlanet and their code does not always return correct values either. I feel like this shouldn't be that hard to figure out but I am stuck. Please help!
TLDR:
How can I resize my application to be the remaining screen space when the softkeyboard is activated?
What renderMode are you using? (in manifest.xml) I found that only cpu is working to get the correct keyboard height.
Also try to set softKeyboardBehavior to none: <softKeyboardBehavior>none</softKeyboardBehavior>
For an InputMethodService in landscape Android automatically presents a text box that shows the text entered via the soft keys. How is it possible to get that text box height, so I can calculate the available screen height in landscape?
Thanks!
Found it!
It works the other way around: I can use whatever portion of the screen height I want, then Android occupies the remaining space with the text box.
When WebView is hardware accelerated, clicking on input field causes keyboard to appear and html is redrawed shifted and duplicated for a moment:
1) When soft keyboard is appearing WebView pans its content to bottom-left, then againt to normal position. Causes short view-able duplication.
2) When changing keyboards (ex. abc->numbers) contents are panned down by keyboard height and then back to normal position. Causes short view-able duplication.
Tested on two Android 4.0 tablets, if hardware accelerations is turned off no such glitches appear.
I failed to found any information on this, has anyone experienced same problem?
So I finally found some solutions:
The entire WebView content moves by layout margin width, so setting it to 0px fixes this problem.
android:windowSoftInputMode="adjustPan" for WebView activity.
I have am developing an android app for V2.2 onwards.
The app is for numeric data input for the elderly
To keep things nice and simple, I am using the phone style input method. This also has the advantage of using nice big keys for them.
In landscape mode, I would like to move the virtual keyboard and position it on the right hand side of the view. The content itself has much more height than width and it would be perfect to have the screen split down the middle horizontally with the content on the left and the virtual keyboard on the right.
Does anyone know if this is possible?
Thanks