Java 如何在mapview上放置一个透明按钮?

Java 如何在mapview上放置一个透明按钮?,java,android,button,android-mapview,Java,Android,Button,Android Mapview,我想把透明(地图下可见)按钮放在mapview上? 我怎样才能做到这一点呢?试着在按钮上使用这个按钮 android:background=“@null”或 android:background=“@android:color/transparent” 编辑: 要放置在上方,请使用相对布局: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.

我想把透明(地图下可见)按钮放在mapview上?
我怎样才能做到这一点呢?

试着在按钮上使用这个按钮 android:background=“@null”或 android:background=“@android:color/transparent” 编辑: 要放置在上方,请使用相对布局:

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.maps.MapView android:id="@+id/google_maps"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:apiKey="@string/maps_key"/>
<Button android:id="@+id/googlemaps_select_location"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_centerHorizontal="true"
        android:text="Select"/>
</RelativeLayout>

您可以将地图包装成框架布局或其他形式。然后在FrameLayout中添加一个按钮,并使用android:layout\u alignParentRight=“true”来显示右、左、上和下。然后,按钮将其边缘与框架布局的边缘对齐,框架布局应环绕地图