2

I have a TextInputEditText as below:

<android.support.design.widget.TextInputLayout
        android:id="@+id/tilEmail"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/Theme.AppCompat">
        <android.support.design.widget.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etEmail"
            android:hint="@string/Email"/>
    </android.support.design.widget.TextInputLayout>

However, if I set the background color for the TextInputEditText, the hint Text disappeared.

<android.support.design.widget.TextInputLayout
        android:id="@+id/tilEmail"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/Theme.AppCompat">
        <android.support.design.widget.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:id="@+id/etEmail"
            android:hint="@string/Email"
            android:background="@android:color/white"/>
    </android.support.design.widget.TextInputLayout>

I am trying to put it in style and then apply the style to the TextInputEditText but it does not work.

Anyone knows how I can customise it? I am working on Android in Xamarin.

Thanks.

Long Dao
  • 1,341
  • 4
  • 15
  • 33

1 Answers1

0

Just set the hint text color to any color (other than your background color)

android:textColorHint="#110F10"

You may also want to set yout text color as well

android:textColor="#110F10"
Kyle
  • 1,013
  • 8
  • 16
  • I tried it already but it does not work. The whole EditText is white. Text only comes when the Input is on focus. – Long Dao Mar 23 '17 at 09:26
  • @LongDao, you mean even when the textColor is changed, you can see the text when the control is focused? I cannot reproduce this issue, have you clear your text in code behind when the focus is lost? – Grace Feng Mar 24 '17 at 06:08