2011-02-26 76 views
0

我有一个格式的表格:如何正确对齐表单?

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

我已经对准的TextView到parentLeft,该按钮parentRight。到目前为止,EditText to toLeftOf Button。现在,我希望EditText能够与最长的TextView对齐,但是我似乎无法使用来自不同布局的TextView的RightOf。我甚至不确定这是做到这一点的最佳方式。

什么是正确的方法让所有事情都能够直接排队?

回答

2

考虑使用TableLayout代替

0

你可以尝试用RelativeLayoutand更换LinearLayout并删除RelativeLayout的每一行或使用TableLayout旭建议。