我怎样才能避免iphone safari第一封大写字母 [英] How can I avoid iphone safari first letter in caps
问题描述
我正在设计一个针对iPhone / iPod touch的小型网页。我有一个需要用户输入代码的表单。当你点击相应的字段时,iphone会自动将第一个字母设置为大写字母。有什么办法可以避免这种情况?我希望整个领域进入小型大写。
谢谢
编辑:使用无而不是关。在您的网页上,您所需要做的就是将autocapitalize属性设置为关闭输入字段。所以:
< input autocapitalize =none>
请参阅和 Safari HTML参考资料
以下是我的答案之前,这涉及到本机应用程序。为任何正在寻找答案的人提供帮助。
从UITextField 文档
键盘本身的外观可以使用UITextInputTraits协议提供的属性进行自定义。文本字段对象实现此协议并支持它定义的属性。您可以使用这些属性来指定要显示的键盘类型(ASCII,数字,URL,电子邮件和其他)。您还可以配置键盘的基本文本输入行为,例如是否支持自动大写和校正文本。
所以基本上,UITextField支持这个协议。所需的财产是autocapitalizationType。代码中的一个例子是:
myUITextField.autocapitalizationType = UITextAutocapitalizationTypeNone;
或者如果您不喜欢点符号:
[myUITextField setAutocapitilizationType:UITextAutocapitalizationTypeNone];
I am designing a small webpage targeted for the iPhone/iPod touch. I have a form that requires the user to enter a code. When you tap on the corresponding field, the iphone will automatically set the first letter to caps. Is there any way to avoid this? I want the whole field to be entered in small caps.
Thanks
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];
这篇关于我怎样才能避免iphone safari第一封大写字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!