android:maxLines - Set the Maximum Viewable Lines of text in a TextView

How to Set the Maximum Viewable Lines of text in a TextView.

add in API Level 1

Makes the TextView be at most this many lines tall. The extra text will default to be scrollable vertically, line by line.

1. Add a TextView in the main.xml file.

2. In the main.xml file, add the code below.

<TextView
        ...
android:maxLines = "1"
/>

3. Compile and run!
Resources:
http://developer.android.com/reference/android/widget/TextView.html#attr_android:maxLines
http://developer.android.com/reference/android/R.attr.html#maxLines