你如何在 iOS 的 HTML 表单字段中关闭自动大写?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5171764/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 07:03:54  来源:igfitidea点击:

How do you turn off auto-capitalisation in HTML form fields in iOS?

ioshtml

提问by Paul D. Waite

By default, iOS's keyboard sets the first letter in text form fields (including type=email) to uppercase. (At least prior to iOS 5.)

默认情况下,iOS 的键盘将文本表单字段(包括type=email)中的第一个字母设置为大写。(至少在 iOS 5 之前。)

Is there any way to disable the autocapitalization?

有没有办法禁用自动大写?

回答by thirtydot

Since iOS 5, type="email"has auto-capitalization disabled automatically, so you simply need:

从 iOS 5 开始,type="email"自动大写自动禁用,所以你只需要:

<input type="email">

For other input types, there are attributes available that do what they say:

对于其他输入类型,有一些属性可以执行它们所说的:

<input type="text" autocorrect="off" autocapitalize="none">

If for some reason you want to support iOS prior to version 5, use this for type="email":

如果出于某种原因您想支持版本 5 之前的 iOS,请将其用于type="email"

<input type="email" autocorrect="off" autocapitalize="none">

More information:

更多信息:

回答by Holly E

Just as a heads up, if you're looking at this example and you're using React Native, you'll want to use those props as camelcase.

提醒一下,如果您正在查看这个示例并且您正在使用 React Native,您将希望将这些 props 用作驼峰式大小写。

autoCapitalize

autoCapitalize

and

autoCorrect

autoCorrect

This confused me a bit until I looked at the React Native Documentation for Text Inputs.

这让我有点困惑,直到我查看了React Native Documentation for Text Inputs