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

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

问题描述

我已经搜索过高 &对此的答案很低,我似乎找不到答案或其他任何有同样问题的人.希望有人能提供帮助?

我有一个在 iPhone UIWebView 中查看的注册网页.用户询问我们是否可以停止输入电子邮件地址的首字母大写.我认为这无关紧要,但显然它可以用于某些电子邮件系统上的本地部分(显然它只是不区分大小写的域).

似乎自动完成是罪魁祸首.我尝试将 autocomplete="off" 添加到 html 中的输入元素,但 iOS 显然忽略了它:

可以在 UIWebView 中的 html 输入文本字段上关闭自动完成功能吗?

谢谢

解决方案

好像Apple现在有一些文档:

<块引用>

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

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

<块引用>

您还可以控制键盘的类型当用户触摸网页中的文本字段时显示.到显示电话键盘、电子邮件键盘或 URL 键盘,使用输入中 type 属性的 tel、email 或 url 关键字元素,分别.要显示数字键盘,请设置模式属性为[0-9]"或d".

这些关键字和模式属性是 HTML 5 的一部分,并且是在 iOS 3.1 及更高版本中可用.以下列表显示了如何显示每种类型的键盘,包括标准键盘.

文本:<input type="text"></input>

电话:<input type="tel"></input>

网址:<input type="url"></input>

电子邮件:<input type="email"></input>

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

http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html#为网页视图配置键盘

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天全站免登陆