Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android EditText Hint Size

Tags:

android

How to reduce EditText Hint size?

like image 772
Sasikumar Avatar asked Jun 29 '10 10:06

Sasikumar


People also ask

How do I set hint size on android?

Using onFocusChanged() listener for changing hint font size is also an option, as addTextChangeListener() won't trigger when user clicks on text field, and blinking cursor will resize to hint font. Also, unlike with TextChangeListener, there is no need to set initial hint font size separately.

How do I change Textinputlayout text size in Android?

You only need to change the android:textSize attribute for the TextInputEditText for the hint size to change.


2 Answers

You can do it by setting a size in the string recource.

For example:

<string name="edittext_hint"><font size="15">Hint here!</font></string> 

then in your XML just write

android:hint="@string/edittext_hint" 

This will resault in a smaller text for the hint but the original size for the input text.

Hopes this helps for future readers

like image 125
Jeka Avatar answered Oct 22 '22 04:10

Jeka


You can reduce the font size on the EditText - that will reduce the size of the hint as well. i.e. android:textSize="16sp"

like image 22
inky Avatar answered Oct 22 '22 02:10

inky