Android: Keyboard covers the inputfield
-
On our project we use Qt 5.15.16. When running on Android we are setting the android:windowSoftInputMode="adjustResize" in AndroidManifest.xml, but the keyboard covers the input. I've seen that a similar issue was fixed on 5.15.13 (QTBUG-97503), however this seems to be reproducible on our side when using 5.15.16. Are there other settings that should be set, when using "adjustResize"? Is there a workaround for this issue?
-
I had similar troubles with something like this and I found the adjustResize option to be unreliable/not working, sometimes seemingly depending on device vendor (citation needed, I guess).
My current solution is, unfortunately, very manual:
I listen to the Keyboard change event, then I use the received keyboard rectangle along with the device pixel ratio to calculate the "correct" rectangle dimensions. I then use a signal to transmit that rectangle to where I need it, which allows me to adjust heights or scroll accordingly.
It's not a pretty solution but it gets the job done in my case.
-
I had the same problem (on other platforms as well). I fixed it by using a Flickable for my display object, and modifying the contentY property when I displayed the keyboard:
flickable.contentY = Math.max(0, (yValue + (height / 2)) - ((flickable.height - inputPanelPopup.height) / 2))
You'll probably need to modify the algorithm for your application, but the idea should work.