How to Set the Maximum Viewable Lines of text in a TextView.
add in API Level 1Makes 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.
...
android:maxLines = "1"
/>
3. Compile and run!
Related Articles:
http://developer.android.com/reference/android/widget/TextView.html#attr_android:maxLines
http://developer.android.com/reference/android/R.attr.html#maxLines