Ionic framework customize native keyboard

2019-09-18 12:16发布

Is it possible to show and customize the native keyboard with Ionic framework? Lets say for example that I want to show the native keyboard when you come to a state and I want the keyboard to only contain specific characters (only letter for example).

2条回答
欢心
2楼-- · 2019-09-18 12:47

Input Type Method

Although you cannot change the makeup of the keyboard, you can use different type parameters on your input elements to control which type of keyboard mobile devices will show.

For an overview of the different types of inputs, check out this site.

Return False Method

In addition to changing the type of keyboard that displays, you can also specifically allow or disable certain characters. Accomplish this by checking each keycode as it is typed. For a reference of keycodes, see here.

<input type="text" onkeypress="if(event.keyCode == 101){ return false; }">

iOS Input Tel

查看更多
We Are One
3楼-- · 2019-09-18 12:55

You can do this with the keyboard plugin. Checkout this plugin

http://ngcordova.com/docs/plugins/keyboard/

查看更多
登录 后发表回答