Android EditText Hint Size

How to reduce EditText Hint size?


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


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


I also had to do this as my hint didn't fit in the EditText at the standard size. So I did this (in the xml set textSize to mHintTextSize):

MYEditText.addTextChangedListener(new TextWatcher(){

                @Override
                public void afterTextChanged(Editable arg0) {
                    // TODO Auto-generated method stub

                }

                @Override
                public void beforeTextChanged(CharSequence arg0, int arg1,
                        int arg2, int arg3) {
                    // TODO Auto-generated method stub

                }

                @Override
                public void onTextChanged(CharSequence arg0, int start, int before,
                        int count) {
                    if (arg0.length() == 0) { 
                        // No entered text so will show hint
                        editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, mHintTextSize);
                    } else {
                        editText.setTextSize(TypedValue.COMPLEX_UNIT_SP, mRealTextSize);
                    }
                }
        });