0
有谁知道一种方法来使用具有相同高度的行数填充父项的表格布局?填充父项但具有相同高度的行的表格布局
在下面的布局中,所有行将具有相同的高度,但是如果添加了第一行的图像视图,则该行将拉伸以适合图像的高度。有没有什么办法让行只显示图像视图的一部分,或者任何可以放在行中的内容?
<TableLayout android:id="@+id/table_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TableRow android:id="@+id/row1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#FF0000FF">
</TableRow>
<TableRow android:id="@+id/row2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#FF00000">
</TableRow>
<TableRow android:id="@+id/row3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#FF00FF00">
</TableRow>
<TableRow android:id="@+id/row4"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#FFFF0000">
</TableRow>
<TableRow android:id="@+id/row5"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:background="#FFFFFFFF">
</TableRow>
</TableLayout>