如何禁用Flutter的TextField中的预测文本? [英] How to disable predictive text in TextField of Flutter?
本文介绍了如何禁用Flutter的TextField中的预测文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想禁用文本字段键盘中的预想文本.在本机android和IOS中并没有那么困难,但是我没有在Flutter中找到解决方案.
我尝试使用自动更正:false和更改键盘类型,但是它不起作用.
TextField(
autocorrect: false,
keyboardType: TextInputType.emailAddress,
decoration: new InputDecoration(hintText: "Enter text"),
autofocus: true,
),
解决方案
如果enableSuggestions
和autocorrect
都不能解决问题,请尝试将keyboardType
设置为 TextInputType.visiblePassword . >
I want to disable predictive text which comes in the keyboard of a textfield. It is not so difficult in native android and IOS but I have not found a solution in a Flutter.
I have tried using autocorrect: false and changing keyboardtypes but it is not working.
TextField(
autocorrect: false,
keyboardType: TextInputType.emailAddress,
decoration: new InputDecoration(hintText: "Enter text"),
autofocus: true,
),
解决方案
If neither enableSuggestions
nor autocorrect
can solve the problem, try setting keyboardType
to TextInputType.visiblePassword.
这篇关于如何禁用Flutter的TextField中的预测文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文