1 votes

Error: attribute Android:hintTextColor not found

I have this code in the activity_main.xml of the Android Studio .

I get the following error:

ERROR: C:\Users\Luciana\AndroidStudioProjects\Intentocalculadora\app\src\main\res\layout\activity_main.xml :34: AAPT: error: attribute Android:hintTextColor not found.

My code is as follows:

<EditText
    android:id="@+id/numero_1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:ems="10"
    android:hint="@string/txt_numero1"
    android:hintTextColor="#757575"
    android:inputType="number"
    android:minHeight="48dp"
    tools:ignore="TextContrastCheck" />            /*  linea 34*/

<EditText
    android:id="@+id/numero_2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:ems="10"
    android:hint="@string/txt_numero2"
    android:hintTextColor="#757575"
    android:inputType="number"
    android:minHeight="48dp"
    tools:ignore="TextContrastCheck" />       /* linea 46*/

1voto

Elenasys Points 67941

It seems to me that you are getting confused....

It is textColorHint instead of hintTextColor .

textColorHint is an attribute of TextInputLayout but not of EditText .

You should add the EditText within a TextInputLayout and assign textColorHint to your TextInputLayout example:

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

    <EditText
        android:id="@+id/numero_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:hint="@string/txt_numero1"
        android:hintTextColor="#757575"
        android:inputType="number"
        android:minHeight="48dp"
        tools:ignore="TextContrastCheck" /> 
 </android.support.design.widget.TextInputLayout>

-1voto

Jony Coding Points 47

Try the following code:

android:textColorHint="#757575"

HolaDevs.com

HolaDevs is an online community of programmers and software lovers.
You can check other people responses or create a new question if you don't find a solution

Powered by:

X