有谁知道一种方法可以让表格布局具有相同高度但填充父级的行数?
在下面的布局中,所有行都将具有相同的高度,但是如果我在第一行添加图像视图,则该行将拉伸以适应图像的高度。有没有办法让该行只显示图像视图的一部分,或者你可以放入其中的任何可以放入该行的内容?
<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>