9

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.

4

2 に答える 2

24

android:maxEmsと組み合わせて最大文字数を指定するために使用しますandroid:singleLine="false"

于 2010-12-02T16:57:35.387 に答える
0

私が知っている唯一の解決策は、プログラムでそれを行うことです。複数のTextViewでそれを行う必要があるのではないかと心配しているので、TextViewをサブクラス化するクラスを作成します。その中には、15文字ごとに改行するロジックを実行します。その後、この新しいTextViewをレイアウトで使用できます。

于 2010-12-02T16:55:35.413 に答える