2010-11-18 9 views
0

追加の画像ボタン「現在の場所」をMapViewの右上に配置する必要があります。どのようにこれを行うにはどのようなアイデア?一般的な質問を作るAndroid MapView - 追加のコントロールを目的の位置にMapViewに追加する方法

:のMapViewに追加のビューオブジェクトを取り付けることができるのMapViewの資料によると
1)。これを行う方法?
2)MapViewの特定の位置に追加のコントロールを配置するにはどうすればよいですか?

答えて

2

次の例では、それを貼り付け、その後、あなたがそれを好きな場所にボタンを移動、コピー、MapViewの上のボタンを追加します。

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/map_main" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" > 


<com.google.android.maps.MapView 
    android:id="@+id/mapview" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:clickable="true" 
    android:apiKey="0y6Hyjz6Kxo-NOV_9KHYF7-ECYeGt99xeyVU3IQ"/> 

<Button 
    android:id="@+id/select_3" 
    android:layout_centerHorizontal="true" 
    android:layout_marginTop="13dp" 
    android:text="Center on Pickup Location" 
    style="@style/BasicButton" 
    android:layout_height = "40dp" 
    android:layout_width = "280dp" 
    android:onClick="selfSelectCenterLocation"> 
</Button> 


</RelativeLayout> 
関連する問題