如何正确对齐表格?

时间:2011-02-26 17:15:23

标签: android android-layout

我的表格格式为:

<LinearLayout>
    <RelativeLayout>TextView EditText Button</RelativeLayout>
    <RelativeLayout>TextView EditText Button</RelativeLayout>
    <RelativeLayout>TextView EditText Button</RelativeLayout>
    <RelativeLayout>TextView EditText Button</RelativeLayout>
</LinearLayout>

我已将TextView与parentLeft对齐,Button与parentRight对齐。到目前为止,EditText为toLeftOf Button。现在,我希望EditText全部与最长的TextView对齐,但是我似乎无法使用来自不同布局的TextView的RightOf。我甚至不确定这是最好的方法。

让一切顺利排队的正确方法是什么?

2 个答案:

答案 0 :(得分:2)

考虑使用TableLayout代替

答案 1 :(得分:0)

您可以尝试将LinearLayout替换为RelativeLayoutand并删除每行RelativeLayout或使用TableLayout作为asahi建议。

相关问题