开发者

Specify number of characters in each line in TextView?

Hey, Is it possible to specify a textview to have 25 characters in a line? I have tried android:maxLength="25" though it shows the first part of the text and the other part disappears.. Thanks

Edit1: I can also put the text into an Ed开发者_JAVA技巧itText.. but I want that the characters that are after 25 chars, go to a new line..


http://developer.android.com/reference/android/widget/TextView.html#attr_android:maxLength

I am afraid, maxLength works for input EditText only. :-(


yes , sure android:maxLength="5" works for TextView to set the maximum number of characters for TextView. You can set android:layout_width="130dip" for the TextView too. That will show the character in the format abc... if the text exceed the layout width.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜