Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make EditText hint all caps

I want to make the EditText hint appear in capital case characters without adding an upper case string in the strings file, Any help?

like image 807
Sherif El Nady Avatar asked Aug 14 '16 16:08

Sherif El Nady


People also ask

How do you make EditText all caps?

You can add the android:textAllCaps="true" property to your xml file in the EditText. This will enforce the softinput keyboard to appear in all caps mode. The value you enter will appear in Uppercase.

How can I type all capital letters in Android?

Want to type in ALL CAPS? No problem! Just double-tap the shift key and a blue indicator will light up. You'll know you're in all caps because the letter keys will change to uppercase.

Why use TextInputLayout?

The primary use of a TextInputLayout is to act as a wrapper for EditText(or its descendant) and enable floating hint animations. Rule of Thumb : TextInputLayout should wrap TextInputEditText instead of the normal EditText.


1 Answers

I think this is an example you can try:

myEditText.setHint(getResources().getString(R.string.your_text_in_string).toUpperCase());
like image 77
Huy Avatar answered Oct 17 '22 08:10

Huy