如何放置一个RelativeLayout的在RelativeLayout的底部? [英] How to place a RelativeLayout at the bottom of a RelativeLayout?

查看:232
本文介绍了如何放置一个RelativeLayout的在RelativeLayout的底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 RelativeLayout的,而这种布局有两个孩子的,一个是图形页面,另一个是 RelativeLayout的,其中包含一个按钮。

I have a RelativeLayout, and this Layout has two childs, one is a MapView and the other a RelativeLayout that contains a button.

我希望它看起来像

但我的透明包装盒(一个 RelativeLayout的)始终显示在地图顶部。

but my transparent box (a RelativeLayout) is always displayed at the top of the map.

<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>   

(我已经留下了一些东西,在code)

(i've left out some things in the code)

推荐答案

尝试添加alignParentBottom选择透明面板。

Try adding a alignParentBottom option to the transparent panel.

<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> 

这篇关于如何放置一个RelativeLayout的在RelativeLayout的底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆