开发者

TextView singleLine="false" without specifying defined width

开发者 https://www.devze.com 2023-03-26 07:17 出处:网络
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\"

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.

0

精彩评论

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