I'm subclassing TextView in a class named Message and adding instances of this class into a ListView. The problem is that if the text the user sets on the Message class is too wide, the v开发者_如何学JAVAiew doesn't wrap words as expected.
What should I do?
There are a couple of things I suspect need to be done:
setSingleLine
tofalse
(sounds like you should do it in the constructor ofMessage
).- Make sure the
layout_height
of the widget you're placing in theListView
isWRAP_CONTENT
(but not thelayout_width
!)
You can also play with setMinLines
and setLines
if it better suits your needs.
精彩评论