Deprecated: How to Set a TextView to 1 Line with ellipsis(...) at end
added in API Level 1, Deprecated in API Level 3Use android:lines or androidmaxLines instead.
Constrains the text to a single line instead of letting it wrap onto multiple lines. If text is longer than one line an ellipsis (...) will automatically be added to the end.
1. Add a TextView in your main.xml file.
2. In the main.xml file, add the code below.
<TextView
...
android:singleLine = "true"
/>
3. Compile and run!
Related Articles:
- android:lines - Change the number of lines of text viewable in a TextView/EditText
- android:maxLines - Set the Maximum Viewable Lines of text in a TextView