Android maxLines and minLines attributes not working in XML

Viewed 3469

I have an XML file which contains an EditText with these attributes:

<EditText
        android:id="@+id/et_firstname"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="@dimen/view_margin_below"
        android:hint="@string/et_firstname"
        android:maxLength="20"
        android:minLines="1"
        android:maxLines="1" />

Since android:singleline is deprecated, I looked for another option and I found these attributes, but they aren't working. I am allowed to enter as many newlines as I want.

2 Answers
Related