Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Android: Keyboard covers the inputfield
QtWS25 Last Chance

Android: Keyboard covers the inputfield

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
android
3 Posts 3 Posters 263 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ap.sirius
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • NaLogoN Offline
      NaLogoN Offline
      NaLogo
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • mzimmersM Offline
        mzimmersM Offline
        mzimmers
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved