Override styles for EditText in Android

android, android-edittext, styles

Solution

For your second problem, this can be helpful(under the EditText tag):

        android:textColorHint="#3b64a8"

In your Activity:

    passwordText.setTypeface(Typeface.SERIF);
    passwordText.setTransformationMethod(new PasswordTransformationMethod());

here "passwordText" is the EditText for password.

Problem

I need to override styles for two EditText instances. I have two issues regarding this: 1) One EditText is for entering a password but with the same typeface. If I delete password=true it works. By default typeface=sans. ``` <style name="customEdit" parent="@android:style/Widget.EditText"> <item name="android:password">true</item> <item name="android:typeface">serif</item> //doesn work. </style> ``` 2) Both fields have hints. And I need to set the color of these hints; is it possible? I didn't find something like this: android:hintColor... ``` <item name="android:textColor">#acacac</item> //works for text only. ``` I tried two variants for password type: - android:inputType="textPassword" - android:password=true Both change typeface to default automaticaly, even in the "UI Constructor".

Original source