Raidline
Raidline

Reputation: 81

Change color of hint EditText - Android

Here i have the color of the hint that i want(Blue),photo nº1, but when i click it goes pink, phot nº2. How can i change that to blue? I have tried to change the hintColor but it does no good.`

<EditText
                android:id="@+id/password"
                android:backgroundTint="@android:color/holo_blue_dark"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="@string/prompt_password"
                android:textColorHint="@android:color/holo_blue_dark"
                android:imeActionId="@+id/login"
                android:imeActionLabel="@string/action_sign_in_short"
                android:imeOptions="actionUnspecified"
                android:inputType="textPassword"
                android:maxLines="1"
                android:singleLine="true" />`

Photo 1

Photo 2

Upvotes: 3

Views: 336

Answers (3)

Mounir Elfassi
Mounir Elfassi

Reputation: 2252

try TextInputLayout :

<android.support.design.widget.TextInputLayout
android:textColorHint="#F7B7C2"
android:layout_width="match_parent"
android:layout_height="match_parent">

<EditText
    android:id="@+id/myid"
    android:textColor="@android:color/black"
    android:hint="something"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
</android.support.design.widget.TextInputLayout>  

Update:

Change your "colorAccent" in your Apptheme in styles.xml file with the color you need

Upvotes: 0

Raidline
Raidline

Reputation: 81

For those who want to know the answer after the comments. Just put this on the style.xml file. Thx a lot

<item name="colorAccent">@android:color/holo_blue_dark</item>

Upvotes: 2

Masum
Masum

Reputation: 4959

You can try with direct color code something like this

android:textColorHint="#4C33FF"

Upvotes: 0

Related Questions