W1ll
W1ll

Reputation: 177

How to add a number row to the android keyboard

In my app I need to add a number row to the Android keyboard, it is possible?, how?

enter image description here

Upvotes: 1

Views: 1862

Answers (1)

Ahmed Hegazy
Ahmed Hegazy

Reputation: 12615

You can't control the keyboard layout, Keyboards may display different layouts based on the input type you provide with the input field. You'll just need to provide the correct android:inputType and let the Keyboard handle it for you.

Also as per the documentation, you can't mix classes together but classes may be combined with variations and flags to indicate desired behaviors. So setting inputType to number|text will not work and will only display a numeric keypad.

There are two tricks which might work on some Keyboards:

  1. Using the android:inputType="textVisiblePassword"

OR

  1. Hiding the suggestions bar using editText.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS)

Upvotes: 3

Related Questions