gpt4 book ai didi

ios - 如何从QML为iOS设置returnKeyType

转载 作者:行者123 更新时间:2023-12-01 21:59:05 25 4
gpt4 key购买 nike

我有一个QML TextField作为搜索字段的输入。在iOS中,当用户单击TextField时,将显示默认的iOS键盘。默认iOS键盘的“returnKey”仅显示“done”。我想改为说“搜索”。

我看到iOS文档显示了可以使用的不同类型的returnKeys,其中确实列出了“搜索”和一个选项:

https://developer.apple.com/documentation/uikit/uitextinputtraits/1624446-returnkeytype
https://developer.apple.com/documentation/uikit/uireturnkeytype

但是我不确定如何在QML中访问它们。可以从QML应用程序中更改吗?

TextField {
id: textInputSearchTerms
font.pointSize: 20
anchors.fill: parent
placeholderText: "Search..."
inputMask: qsTr("")
}

我正在使用Qt 5.12.3

最佳答案

从Qt 5.6起应该可以使用:

TextField {
EnterKey.type: Qt.EnterKeySearch
}

Documentation

关于ios - 如何从QML为iOS设置returnKeyType,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60662169/

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