Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have an EditText and it should display alphanumeric keyboard (both letters and numbers visible on keyboard). Letters must be upper case. What attributes should I set for EditText? I tried:

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textVisiblePassword"
    android:textAllCaps="true" />

This shows lower case alphanumeric keyboard.

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textCapCharacters"
    android:textAllCaps="true" />

And this shows upper case keyboard but without numbers.

I need a keyboard like this: enter image description here

Both numbers and upper case letters visible on default layout (without the need to switch CAPS on, or in other words with CAPS turned on in default).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
145 views
Welcome To Ask or Share your Answers For Others

1 Answer

try inputType = textVisiblePassword|textCapCharacters

<EditText
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:inputType="textVisiblePassword|textCapCharacters" />

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...