iPhone的UIWebView - 可以自动完成对输入文本字段被关闭? [英] iPhone UIWebView - Can auto complete be turned off on a input text field?

查看:466
本文介绍了iPhone的UIWebView - 可以自动完成对输入文本字段被关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜查高和放大器;低这个答案,我似乎无法找到答案或其他人有同样的问题。希望有人能帮助?

我有哪些,我看在iPhone UIWebView中注册一个网页。用户在问我们是否能够被输入上的电子邮件地址的第一个字母停止资本。我认为这根本不算什么,但显然它可以为一些电子邮件系统的本地部分(显然它的唯一,这只是区分大小写域)。

这似乎是自动完成的罪魁祸首。
我试着加入自动完成=关闭在HTML input元素,但iOS的显然是忽略它:

可以自动完成上一个HTML输入文本字段一个UIWebView内关闭?

感谢


解决方案

好像苹果现在有一些文档:


  

虽然UIWebView类不支持UITextInputTraits
  协议直接,您可以配置一些文本属性键盘
  输入元素。例如,您可以包括自动更正和
  自动大写在输入元素的定义属性
  指定键盘的行为,如列于下
  例子。


 <输入类型=文字大小=30自动更正=关闭autocapitalize =关>


  

您还可以控制键盘上的类型
  当用户在网页中触摸一个文本字段被显示。至
  显示一个电话键盘,电子邮件键盘,或网址键盘,使用
  在电话,电子邮件或URL关键字,用于对输入的类型属性
  元素,分别为。要显示一个数字键盘,设置的值
  模式属性设置为[0-9]的或\\ D 的。


  
  

这些关键字和图案属性是HTML 5的一部分,并且
  在IOS 3.1及更高版本。下面的列表显示了如何
  显示每个类型的键盘,包括标准键盘。


正文:<输入类型=文本>< /输入>

电话:<输入类型=电话>< /输入>

网址:<输入类型=URL>< /输入>

电子邮件:<输入类型=电子邮件>< /输入>

邮编code:<输入类型=文本模式=[0-9] *>< /输入>

<一个href=\"http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html#Configuring%20the%20Keyboard%20for%20Web%20Views\" rel=\"nofollow\">http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html#Configuring键盘的Web浏览

I've searched high & low for an answer on this and I can't seem to find an answer or anybody else having the same issue. Hope some one can assist?

I have a web page for signup which I'm viewing in an iPhone UIWebView. A user is asking if we can stop capitalization on the first letter of the email address being entered. I thought this didn't matter, but apparently it can for the local-part on some email systems (apparently it's only the domain that is only case insensitive).

It seems autocomplete is the culprit. I've tried adding autocomplete="off" to the input element in the html, but iOS is obviously ignoring it:

Can auto-complete be turned off on a html input text field within a UIWebView?

Thanks

解决方案

Seems like Apple have some documentation now:

Although the UIWebView class does not support the UITextInputTraits protocol directly, you can configure some keyboard attributes for text input elements. For example, you can include autocorrect and auto-capitalization attributes in the definition of an input element to specify the keyboard’s behaviors, as shown in the following example.

   <input type="text" size="30" autocorrect="off" autocapitalize="off">

You can also control which type of keyboard is displayed when a user touches a text field in a web page. To display a telephone keypad, an email keyboard, or a URL keyboard, use the tel, email, or url keywords for the type attribute on an input element, respectively. To display a numeric keyboard, set the value of the pattern attribute to "[0-9]" or "\d".

These keywords and the pattern attribute are part of HTML 5, and are available in iOS 3.1 and later. The following list shows how to display each type of keyboard, including the standard keyboard.

Text: <input type="text"></input>

Telephone: <input type="tel"></input>

URL: <input type="url"></input>

Email: <input type="email"></input>

Zip code: <input type="text" pattern="[0-9]*"></input>

http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html#Configuring the Keyboard for Web Views

这篇关于iPhone的UIWebView - 可以自动完成对输入文本字段被关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆