iPhone UIWebview: How to force a numeric keyboard? Is it possible?

后端 未结 10 1788
清酒与你
清酒与你 2020-12-02 09:34

I\'m experimenting with PhoneGap to develop some iPhone apps. PhoneGap basically wraps a UIWebView - it works well. The problem is the my app has several input fields that

10条回答
  •  孤城傲影
    2020-12-02 10:13

    It looks like Mobile Safari supports the new HTML5 input type attributes of email, number, search, tel, and url. These will switch the keyboard that is displayed. See the type attribute.

    So for example, you could do this:

    
    

    And when the input box has focus, the number keyboard is shown (as if the user had the full keyboard and hit the "123" button.

    If you really only want numbers, you could specify:

    
    

    And then the user would get the phone number dialing keypad.

    I know this works with Mobile Safari -- I only assume it will work with UIWebView.

提交回复
热议问题