How can I avoid iphone safari first letter in caps

痞子三分冷 提交于 2019-12-04 23:53:43
bobDevil

Edit: use "none" instead of "off". On your webpage, all you need to do is set the autocapitalize property to off for your input field. So:

<input autocapitalize="none">

See the Safari Web Content Guide: Designing Forms and Safari HTML Reference

Below is the answer I had before, which relates to native apps. Keeping around for anyone who's looking for that answer.

From the UITextField Documentation

The appearance of the keyboard itself can be customized using the properties provided by the UITextInputTraits protocol. Text field objects implement this protocol and support the properties it defines. You can use these properties to specify the type of keyboard (ASCII, Numbers, URL, Email, and others) to display. You can also configure the basic text entry behavior of the keyboard, such as whether it supports automatic capitalization and correction of the text.

So basically, the UITextField supports this protocol. The property needed is the autocapitalizationType. An example in code is:

myUITextField.autocapitalizationType = UITextAutocapitalizationTypeNone;

or if you dislike the dot notation:

[myUITextField setAutocapitilizationType:UITextAutocapitalizationTypeNone];

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

<input type="text" autocorrect="off" autocapitalize="off">
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!