0

マップビューの上に透明な(その下にマップが表示される)ボタンを配置したいですか?どうすればそれを達成できますか?

4

2 に答える 2

1

ボタン 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>
于 2012-07-24T07:56:50.123 に答える
0

マップをFrameLayoutなどでラップすることができます。次に、FrameLayoutにボタンを追加し、android:layout_alignParentRight="true"右、左、上、下に使用します。次に、ボタンはそのエッジをFrameLayoutのエッジに揃えます。FrameLayoutはマップをラップしているはずです。

于 2012-07-24T08:11:27.210 に答える