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

17,746

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

Share:
17,746
NotACleverMan
Author by

NotACleverMan

Updated on July 23, 2022

Comments

  • NotACleverMan
    NotACleverMan almost 2 years

    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.

  • Chintan Khetiya
    Chintan Khetiya about 10 years
    I don't think that we need to use android:singleLine="false" also maxEms is okay.