开发者

How to properly align form?

I have a form with a format of:

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

I have aligned the TextView to parentLeft, the Button to parentRight. And so far, the EditText to t开发者_StackOverflow社区oLeftOf Button. Now, I want the EditText to all line up with the longest TextView, however I can't seem to use toRightOf of a TextView from a different layout. I'm not even sure that's the best way to do it.

What is the proper way to get everything to line up straight?


Consider using TableLayout instead


You can try replacing the LinearLayout with RelativeLayoutand and remove the RelativeLayout for each row or use TableLayout as asahi suggested.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜