I'm trying to get a textview to take have mutiple lines and cut at the size of the parent.
<TableLayout android:layout_height="wrap_content"
android:layout_width="fill_parent">
开发者_JAVA百科 <TableRow android:gravity="left">
<TextView android:id="@+id/deal_title"
android:paddingLeft="5dp" android:layout_height="wrap_content" android:singleLine="false"
android:layout_width="fill_parent" style="@style/dealrowtitle" />
</TableRow>
</TableLayout>
This does not force it to only be the width of this view. The text goes off screen.
The text view will only force if I give it a pixel count.
You could use android:maxWidth="10dip"
to prevent the textview from growing more than the specified width.
精彩评论