开发者

How to properly align form?

开发者 https://www.devze.com 2023-02-14 03:18 出处:网络
I have a form with a format of: <LinearLayout> <RelativeLayout>TextView EditText Button</RelativeLayout>

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

精彩评论

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