QT Android Gboard与输入字段重叠

问题描述

由于Gboard Qt的最新更新似乎在检测到它并相应地将输入字段推到它上面时出现问题。 Gboard版本:9.7.09.323382208-tv_release-armeabi-v7a

enter image description here

我有一个最小的代码示例,可以很容易地复制它:

import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.12

applicationwindow {
    width: 1920
    height: 1080
    visibility: Window.Maximized
    color: "#C0C0C0"

    Item
    {
        width: 1920 * 0.7
        height: 1080 * 0.8
        Item {
            width: parent.width
            height: parent.height * 0.4
            id: we
        }
        TextField
        {
            id: input1
            width: parent.width
            focus: true
            anchors.top: we.bottom
            onAccepted: input2.focus = true

            Keys.onpressed:
            {
                switch (event.key) {
                case Qt.Key_Tab:
                case Qt.Key_Down:
                    event.accepted = true
                    input2.forceActiveFocus()
                    break
                }
            }
        }

        TextInput
        {
            id: input2
            width: parent.width
            anchors.top: input1.bottom
            maximumLength: 40

            Keys.onpressed:
            {
                switch (event.key) {
                case Qt.Key_Tab:
                case Qt.Key_Down:
                    event.accepted = true
                    break

                case Qt.Key_Up:
                    event.accepted = true
                    input1.forceActiveFocus()
                    break
                }
            }
        }
    }
}

我尝试使用Qt版本进行构建:5.12.95.13.25.14.25.15.1,并且都存在相同的问题。但是,Android Studio中的一个空项目会正确推送输入字段,因此问题必须与Qt有关。

我还尝试设置android:windowSoftInputMode="adjustPan",但是它根本没有效果

我发现的是QtActivityDelegate.java中的Qt showSoftwareKeyboard方法,我认为它负责显示键盘和调整布局,因此我尝试了一下(设置一些难点,编码值,例如m_layout.setLayoutParams(m_editText,new QtLayout.LayoutParams(width,680,30,500),false)),使用更改重建Qt,但是没有成功或看不到更改,它会打印出我的自定义日志,因此更改可以正确应用。

有什么主意如何使其推动输入字段?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)