Android EditText setHint's font size dynamically

666 views Asked by At

I've been struggling with setting size of hints in my EditText. The hint's font size becomes too large and the layout starts to look horrible!

EditText dummy = new EditText();
dummy.setHint("some hint");

How do I dynamically and programmatically change the hint's font size w.r.t my priorly set MAX_HINT_SIZE (in pixels)?

1

There are 1 answers

1
Neal Ahluvalia On BEST ANSWER

Found something for you

editTextPassword.setHint(Html.fromHtml("<font size=\"16\">" + "Password " + "</font>" + "<small>" + "(at least 12 charcters)" + "</small>" ));

See the accepted answer here