I have a CordovaWebView that presents some html forms. When i focus on an input field, the Android's soft keyboard pops up and, for certain fields, according to their position, it gets on top of it. Basically, it is not resizing the layout of CordovaWebView.
Whatever i do, i can't change this, and it is said that it is related to the fact that the CordovaWebView is in fullscreen mode.
How can i accomplish to resolve this?
PS: is it, or not, a bug?
Thank you all!
In fact, it is a well know bug, as @user2493245 said. But I found a workaround, at least regarding my specific case.
on WebView, just check for the coordinates for the View's visible area.
As you can see, I send that information to the WebView. On HTML, I have this two methods to handle the issue:
Basically, onKeyBoardShow, it gets the input field focused and calculates the amount of pixels that will be necessary to move the body, allowing the user to see the input field. onKeyBoardHide, simply puts the body to its original position.
PS: This only functions when the viewport targets devicedpi, as we need to modify the way we get the dif regarding the dpi of the device.
PS2: First amount of code is not mine, I only edited to fill my needs. I saw that on a SO question, but unfortunatelly now i can't find it. If i find it, i'll post the link here.
Remove
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
from manifest, and add these 2 lines of code:Make sure your onCreate method looks like this:
And everything will work :D.
I have the same problem and i found out it is a well known bug.
A workaround could be that u write a plugin that disables the fullscreen just before the softkeyboard pops up and reenables it afterwards.