如何在安卓上移除单词提示?

huangapple go评论91阅读模式
英文:

How to remove word hints on android?

问题

我有这些提示 如何在安卓上移除单词提示?

如何在 Android 浏览器中删除它?

是否可以使用 JavaScript 实现?

英文:

I have those hints 如何在安卓上移除单词提示?

Have can I remove it from browser by android?

Is this possible with JavaScript?

答案1

得分: 1

在HTML中,禁用<input>元素的autocompletespellcheckautocorrectautocapitalize属性。

  1. <input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" />

如果要通过JavaScript来实现,可以使用setAttribute()方法。

  1. const text = document.getElementById("text");
  2. text.setAttribute("autocomplete", "off");
  3. text.setAttribute("autocorrect", "off");
  4. text.setAttribute("autocapitalize", "off");
  5. text.setAttribute("spellcheck", "false");

请注意,上面的代码示例中使用了一个具有id属性为"text"的<input>元素。

英文:

In HTML, disable the autocomplete, spellcheck, autocorrect, and autocapitalize attributes on the &lt;input&gt; element.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

  1. &lt;input type=&quot;text&quot; autocomplete=&quot;off&quot; autocorrect=&quot;off&quot; autocapitalize=&quot;off&quot; spellcheck=&quot;false&quot; /&gt;

<!-- end snippet -->

Do you want to do it through JavaScript? Use the setAttribute() method.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-js -->

  1. const text = document.getElementById(&quot;text&quot;);
  2. text.setAttribute(&quot;autocomplete&quot;, &quot;off&quot;);
  3. text.setAttribute(&quot;autocorrect&quot;, &quot;off&quot;);
  4. text.setAttribute(&quot;autocapitalize&quot;, &quot;off&quot;);
  5. text.setAttribute(&quot;spellcheck&quot;, &quot;false&quot;);

<!-- language: lang-html -->

  1. &lt;input type=&quot;text&quot; id=&quot;text&quot; /&gt;

<!-- end snippet -->

答案2

得分: -1

  1. const MyTextInput = () =&gt; {
  2. return (
  3. &lt;View&gt;
  4. &lt;TextInput
  5. autoCorrect={false}
  6. /&gt;
  7. &lt;/View&gt;
  8. );
  9. };

将autoCorrect={false}属性设置为false后,TextInput在您的应用程序中应禁用单词建议和更正。

英文:

something like:

  1. const MyTextInput = () =&gt; {
  2. return (
  3. &lt;View&gt;
  4. &lt;TextInput
  5. autoCorrect={false}
  6. /&gt;
  7. &lt;/View&gt;
  8. );
  9. };

With the autoCorrect={false} property set, the word suggestions and corrections should be disabled for the TextInput in your app.

huangapple
  • 本文由 发表于 2023年7月23日 22:21:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/76748731.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定