我正在使用 TableLayout 和 TableRow 创建一个简单的布局,其中包含两个 TextView。这是代码的一部分。
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:stretchColumns="0">
<TableRow android:id="@+id/myTableRow">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dip"
android:text="Short description"/>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dip"
android:text="Large description"/>
</TableRow>
问题是,如果 TextView 1 中有长文本,则不会显示全文。如何在 TextView 1 中显示全文?
尝试更新 XML 您给出的问题...可能这就是您想要做的。
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TableRow android:id="@+id/myTableRow" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="15dip"
android:text="Short description" />
<TextView
android:id="@+id/textView1"
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="15dip"
android:text="Large description" />
</TableRow>
</TableLayout>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)