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

扶醉桌前 提交于 2019-11-30 18:26:41

Add autocorrect="off" attribute to your input text field.

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

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