如何将RelativeLayout放在RelativeLayout的底部?

Upv*_*ote 4 android android-linearlayout android-relativelayout

我有一个RelativeLayout,这个布局有两个孩子,一个是a MapView,另一个是RelativeLayout包含一个按钮.

我希望它看起来像那样

但我的透明框(a RelativeLayout)始终显示在地图的顶部.

<RelativeLayout 
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">

  <com.google.android.maps.MapView
    android:id="@+id/mapView"/>

    <test.project.TransparentPanel 
      android:layout_width="fill_parent"
      android:layout_width="fill_parent">   

        <Button 
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Click Me!"/>   

    </test.project.TransparentPanel>

</RelativeLayout>   
Run Code Online (Sandbox Code Playgroud)

(我在代码中遗漏了一些东西)

Kon*_*rov 11

尝试将alignParentBottom选项添加到透明面板.

<RelativeLayout 
  android:layout_width="wrap_content"
  android:layout_height="wrap_content">

  <com.google.android.maps.MapView 
    android:id="@+id/mapView"/>

  <test.project.TransparentPanel
    android:layout_width="fill_parent"
    android:layout_width="fill_parent"
    android:layout_alignParentBottom="true">

      <Button 
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content" 
        android:text="Click Me!"/>         

  </test.project.TransparentPanel>

</RelativeLayout> 
Run Code Online (Sandbox Code Playgroud)