【发布时间】:2013-04-30 11:26:32
【问题描述】:
我在 LinearLayout 中并排使用 2 个表格,它们都填充了 50% 的屏幕宽度。在该 LinearLayout 下方,有一个 RelativeLayout,其中包含另一个表格。
类似这样的:
<LinearLayout>
<TableLayout>
<TableRow>
...
</TableRow>
</TableLayout>
<TableLayout>
<TableRow>
...
</TableRow>
</TableLayout>
</LinearLayout>
<RelativeLayout>
... some views ...
<TableLayout>
<TableRow>
...
</TableRow>
</TableLayout>
</RelativeLayout>
现在我希望RelativeLayout 中的表格与LinearLayout 中的第一个表格具有相同的宽度。我以为我可以用 android:layout_alignRight="@+id/Linearlayout_table1" 来做,但那行不通。
那么,有没有办法做到这一点?
【问题讨论】:
-
要使该属性起作用,引用的布局应包含在 RelativeLayout 中。
-
以及在RelativeLayout中绘制TableView后剩余的空间是什么......你要添加一些其他视图吗?
标签: android alignment android-linearlayout android-relativelayout