gpt4 book ai didi

android - 当设备的(android)键盘处于 Activity 状态时移动弹出窗口

转载 作者:行者123 更新时间:2023-11-30 00:43:07 25 4
gpt4 key购买 nike

我想在键盘处于 Activity 状态时移动弹出窗口,因为现在键盘覆盖了弹出窗口。我如何知道键盘的大小以正确移动弹出窗口?

Popup {
id: popupName
contentWidth: parent.width/2
contentHeight: parent.height/2

x: parent.width/2 - popupName.width/2
y: parent.height/2 - popupName.height/2

background: Rectangle {
color: "#424242"
}

enter image description here

最佳答案

您也许可以使用 Qt.inputMethod.keyboardRectangle :

The inputMethod object allows access to application's QInputMethod object and all its properties and slots. See the QInputMethod documentation for further details.

docs for QInputMethod说:

This property holds virtual keyboard's geometry in window coordinates.

This might be an empty rectangle if it is not possible to know the geometry of the keyboard. This is the case for a floating keyboard on android.

我不确定您屏幕截图中的键盘是否被视为“ float 键盘”。

关于android - 当设备的(android)键盘处于 Activity 状态时移动弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42237948/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com