在RelativeLayout中对齐组件

Rag*_*har 4 user-interface android relativelayout

| --Button 1-- |

| -Button 2- |

使用RelativeLayout如何对齐Button 2的宽度以匹配Button 1的宽度.

Var*_*run 5

<Button
        android:id="@+id/A"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginLeft="40dip"
        android:textSize="14sp"
        android:text="--Button1--" />

<Button
        android:id="@+id/B"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@id/A"
        android:gravity="center"
        android:text="Button2"
        android:layout_alignLeft="@id/A"
        android:layout_alignRight="@id/A"
        android:textSize="14sp" />
Run Code Online (Sandbox Code Playgroud)

在你的内心尝试以上内容 RelativeLayout