Android custom keyboard layout leaving a margin of white at the side

后端 未结 6 2184
渐次进展
渐次进展 2021-02-20 03:59

I\'m working on a custom keyboard for Android, and I\'ve run in to an issue where the keyboard seems to leave a white line/space at right, instead of filling the parent view...

6条回答
  •  忘掉有多难
    2021-02-20 04:40

    I had this problem too. I never found a good solution.

    Android's Keyboard layout API sucks. If I were doing this all over again I would not have used it and instead created my own UI from scratch interfacing with InputMethod directly.

    In any case, my solution was to add an extra key at the bottom of the layout with a 100% width and only 1dp height.

    The button does absolutely nothing and the height is so small the user doesn't see it. But the width of the key fixes the gap issue.

提交回复
热议问题