【发布时间】:2014-03-26 16:07:22
【问题描述】:
我正在处理一个包含地图的活动,并尝试在其上添加按钮,这就是我的 xml 的样子
这是我的 xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/multi_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:baselineAligned="false"
android:orientation="horizontal" >
<FrameLayout
android:id="@+id/container_a"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1" >
</FrameLayout>
<RelativeLayout
android:layout_width="0dp"
android:id="@+id/container_b"
android:layout_height="match_parent"
android:layout_weight="1" >
<fragment
android:id="@+id/map_fragment"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RadioGroup
android:id="@+id/radio_group_list_selector"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#80000000"
android:orientation="horizontal"
android:padding="4dp" >
<Button
android:id="@+id/driving"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bkg"
android:drawableTop="@drawable/car"
android:gravity="center_horizontal|center_vertical" />
<Button
android:id="@+id/radioAZ"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bkg"
android:drawableTop="@drawable/walk"
android:gravity="center_horizontal|center_vertical" />
<Button
android:id="@+id/bicycling"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@drawable/bkg"
android:drawableTop="@drawable/bicycle"
android:gravity="center_horizontal|center_vertical" />
</RadioGroup>
</RelativeLayout>
但是,当我运行该应用程序时,该地图仍然位于按钮顶部,有人知道我如何将按钮放在地图顶部以便用户可以看到和使用它们吗?沿着 z-index 线左右的东西?
【问题讨论】:
标签: android xml google-maps button