如何在MobileSafari / UIWebView中阻止键盘自动完成? [英] How can I prevent keyboard autocompletion in MobileSafari/UIWebView?
问题描述
我正在< input>上实现我自己的自动完成功能。 UIWebView中的字段,内置键盘自动完成会干扰用户体验。有没有办法使用HTML或Javascript向iOS发出不应该尝试自动完成的信号?
I'm implementing my own autocompletion on an <input> field inside a UIWebView, and the built-in keyboard autocompletion interferes with the user experience. Is there a way to use HTML or Javascript to signal to iOS that it shouldn't try to autocomplete?
推荐答案
在我的评论中我提到使用html属性 autocomplete
但我测试了它,但它没有解决你的问题。但是,有一个特定于Mobile Safari的属性可能有所帮助。您可以尝试关闭自动更正,如下所示:
In my comments I mentioned using the html attribute autocomplete
but I tested it, and it doesn't address your issue. However, there is an attribute specific to Mobile Safari which may help. You could try turning off autocorrect like so:
<input type="text" id="your-field" autocorrect="off" />
这篇关于如何在MobileSafari / UIWebView中阻止键盘自动完成?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!