无法理解,为什么按钮的大小不一致。早些时候,我使用LinearLayout而不是RelativeLayout作为根,但是经过一些Google搜索之后,我明白,没有机会使用LL来创建页脚,因此我通过将以前的LL与按钮复制到RL来进行调整,但是.. Look at this. I found it with ruler. It really cut my eyesRelativeLayout中LinearLayout内部按钮的宽度不相等
此外我无法理解,为什么RL中的保证金无法正常工作(我从下面的代码中删除),以及我如何在RL内保证金元素?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout_root"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/linearLayout_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
<Button
android:id="@+id/button_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/all_mentions_Add" />
<Button
android:id="@+id/button_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/all_mentions_Delete" />
</LinearLayout>
<ListView
android:id="@+id/listView_mentions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/linearLayout_buttons" >
</ListView>
</RelativeLayout>
我试图在RL内设置余量。它不会让孩子成为保证金。例如,LL做的。 – Nexen