The android:singleLine
attribute has been deprecated since API Level 15. 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
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minLines="2"
android:maxLines="2" /> <!-- can specify arbitrary number of max lines -->