Properly resize main kivy window when soft keyboard appears on android

徘徊边缘 提交于 2019-12-12 02:13:25

问题


I'm trying to use Window.softinput_mode to resize the window content when the soft keyboard appears:

softinput_mode = 'resize'

With this mode, the window is resized (i.e., window height is reduced by keyboard_height), but the keyboard still overlaps the content because, as it seems, the adapted window y coordinate is reduced by keyboard_height.

How can i vertically top-align the window content when the soft keyboard appears?

The modes 'pan' and 'below_target' didn't also help, because with them the window is moved along the y-axis (+ keyboard_height) so the top part of the window content is invisible.

EDIT: A minimal code (taken and adapted from a kivy git-issue), that illustrates the described behavior when ran on Android: http://pastebin.com/EzKCRMj7

来源:https://stackoverflow.com/questions/36770050/properly-resize-main-kivy-window-when-soft-keyboard-appears-on-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!