如何隐藏适用于iOS和Android的钛手机键盘上的快速建议



键入文本时,键盘上添加了一些空格并显示文本建议,我想在我的应用程序中禁用这些建议。请让我知道该怎么做。

TSS 代码

"#emailtextfield[platform=android]":{
top: "3%",
height: "6%",
width: '70%',
paddingLeft: 5,
borderRadius: 3,
font:{
    fontSize: Alloy.Globals.smallfont
},
backgroundColor: '#000000',
opacity: '0.5',
color: '#fff',
autocorrect:false,
autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
softKeyboardOnFocus: Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS,
keyboardType: Ti.UI.KEYBOARD_EMAIL
},
"#passwordtextfield[platform=android]":{
top: "2%",
height: "6%",
width: '70%',
paddingLeft: 5,
borderRadius: 3,
autocorrect:false,
font:{
    fontSize: Alloy.Globals.smallfont
},
backgroundColor: '#000000',
opacity: '0.5',
color: '#fff',
autocapitalization: Ti.UI.TEXT_AUTOCAPITALIZATION_NONE,
softKeyboardOnFocus: Ti.UI.Android.SOFT_KEYBOARD_SHOW_ON_FOCUS,
keyboardType: Ti.UI.KEYBOARD_EMAIL
}

XML代码

<TextField id="emailtextfield" hintText="Email/Username"></TextField>
<TextField id='passwordtextfield'hintText="Password"passwordMask="true"></TextField>

在文档中,我看到文本字段名为 autocorrect 的属性。它应该对你有所帮助。将其设置为 false。

编辑:事实证明autocorrectsuggestion是两回事。可以从键盘设置中关闭这些建议。在安卓上,可以有多个键盘,因此请验证您正在使用的键盘。而自动更正是用于替换拼写错误的单词的文本字段属性。

最新更新