gpt4 book ai didi

android - 如何将 RelativeLayout 放置在 RelativeLayout 的底部?

转载 作者:太空宇宙 更新时间:2023-11-03 11:41:29 28 4
gpt4 key购买 nike

我有一个 RelativeLayout,这个 Layout 有两个 child ,一个是 MapView,另一个是包含按钮的 RelativeLayout

我希望它看起来像那样

但是我的透明框(RelativeLayout)总是显示在 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>

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

最佳答案

尝试向透明面板添加 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>

关于android - 如何将 RelativeLayout 放置在 RelativeLayout 的底部?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3492721/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com