HOW TO RESTRICT TEXTVIEW TO ONE LINE IN ANDROID

Restricting or limiting TextView to one or any number of lines is quite easy. You just need to use the attribute android:maxLines in your XML file.

You can also limit the number of lines in TextView programmatically in your Java file as given below.

 

Leave a Reply