When an EditText is in password mode, it seems that the hint is shown in a different font (courrier?). How can I avoid this? I would like the hint to appear in the same font that when the EditText is not in password mode.
My current xml:
<EditText
android:hint="@string/edt_password_hint"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:password="true"
android:singleLine="true" />
This how to make input password that has hint which not converted to * and default typeface !!.
On XML :
On Activity :
thanks to : mango and rjrjr for the insight :D.
In case you are using the calligraphy library in combination with a TextInputLayout and an EditText, the following code works well.
The other answers are the right solution for most cases.
However, if you're using a custom
EditText
subclass to, say, apply a custom font by default, there's a subtle issue. If you set the custom font in the constructor of your subclass, it will still be overwritten by the system if you setinputType="textPassword"
.In this case, move your styling to
onAttachedToWindow
after yoursuper.onAttachedToWindow
call.Example implementation:
use the calligraphy library.
then it still wont update the password fields with the right font. so do this in code not in xml:
You can also use the
together with
This is what I did to fix this problem. For some reason I didn't have to set the transformation method so this may be a better solution:
In my xml:
In my
Activity
: