Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there anyway to automatically make a TextView go to a new line after a certain amount of characters?

I can do this programmatically, but it is really inefficient, and also time consuming if I ever need to do it for multiple TextViews.

I want a TextView to go to a new line after 15 characters, every 15 characters. I tried using android:maxLength="15" but that just stopped the string at 15 characters. No new line or anything.

like image 487
NotACleverMan Avatar asked Dec 02 '10 16:12

NotACleverMan


1 Answers

Use android:maxEms to specify a maximum amount of characters in conjunction with android:singleLine="false".

like image 136
Octavian A. Damiean Avatar answered Nov 16 '22 02:11

Octavian A. Damiean