Pratik Butani - 1 year ago 762
Android Question

# Alternative of singleLine attribute (Deprecated) TextInputEditText

I recently used

TextInputEditText
and I got lint error that
singleLine
attribute is Deprecated

<android.support.design.widget.TextInputEditText
android:id="@+id/my_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/string_hint_dob"
android:lines="5"/>
</android.support.design.widget.TextInputLayout>


Getting strike-through as below:

Is there any alternative way for this or any reason to make it deprecated?

The android:singleLine attribute has been deprecated since API Level 3. You can achieve the same behaviour by using android:maxLines, which allows you to specify an arbitrary number of lines. This is superior to android:singleLine, which restricts you to only allowing one line.
<TextView