XML : Textview seterror doees not display error text [duplicate]

This question already has an answer here:

I have a spinner like this:

   <com.rey.material.widget.Spinner        style="@style/loginSignUpSpinner"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:id="@+id/spinner1"        app:spn_label="Spinner1"/>    

To display error for no selection, I wrote a TextView like this:

    <TextView android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:id="@+id/spinner1_error"        style="@android:style/Widget.EditText"/>    

In my Java code, wherever I had to set error, I wrote:

  spinner1_error.setError("An error occured");    

The problem is, this approach shows only the error icon as shown below:

How to make the error text also visible?

No comments:

Post a Comment