How to create a top numeric bar on your Android keyboard

Asked

Viewed 219 times

4

Does anyone know how to create in Edittext XML that number bar on the keyboard?

inserir a descrição da imagem aqui

3 answers

3


This bar appears when you arrow inputType as textPassword, but this will depend on the Android keyboard. If you want to use for an editText with visible text, you can use a textVisiblePassword.

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/editText"
    android:hint="Search"
    android:inputType="textPassword" />

or

<EditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/editText"
    android:hint="Search"
    android:inputType="textVisiblePassword" />

1

You can set up a inputType for your EditText:

<EditText
    ...
    android:inputType="textPassword|number" ... />

0

  • Thank you, but I will continue to wait for other opinions or solutions, to see if anyone knows anything simpler than creating a custom keyboard...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.