2011-10-15 8 views
0

こんにちは私のapplication.itでは正しく表示されていますが、問題は私がマップビューをタッチしたときに移動していない場合です。ユーザーが近くの場所を見たい場合はその場所に移動できません。いずれかのビューは、任意の場所を1つでもが移動したものではない理由を教えてくださいすることができ、デフォルトでは触れられているときのMapViewが私のlayout.hereでタッチイベントに応答していないと言うことができることは別の場所に移動し、私のレイアウトコードandroidのMapViewのタッチイベント

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="#FFFFFF"> 
    <TextView 
    android:id="@+id/name" 
    android:layout_width="fill_parent" 
    android:layout_height="50px" 
    android:textSize="20sp" 
    /> 
    <TextView 
    android:id="@+id/link" 
    android:layout_width="fill_parent" 
    android:layout_height="50px" 
    android:autoLink="web"/> 
    <TextView 
    android:id="@+id/department" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    /> 
    <TextView 
    android:id="@+id/count" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"/> 
    <TextView 
    android:id="@+id/location" 
    android:layout_width="fill_parent" 
    android:layout_height="80px" /> 
    <LinearLayout 
    android:orientation="horizontal" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 
    <TextView 
    android:id="@+id/longitude" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="1"/> 
    <TextView 
    android:id="@+id/latitude" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="1"/> 
    </LinearLayout> 
    <LinearLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal"> 
    <Button 
    android:id="@+id/zoomin" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    android:text="ZoomIn"/> 
<Button 

android:id="@+id/zoomout" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:layout_weight="1" 
android:text="Zoom Out"/> 

    </LinearLayout> 
    <com.google.android.maps.MapView 
    android:id="@+id/mapview" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:apiKey="0PmsmqKFKflNmHXD2fwG_vPWnR2gA-YB2QVlIQA" 
       android:layout_weight="2" 
       /> 

</LinearLayout> 

です私はタッチイベントでそれが移動するようにする必要があります。

+0

のMapView? –

答えて

2

私はあなたがそのは何もしていないマップを移動しようとすると...それはあなたのXML内部theese二行

android:enabled="true" 
android:clickable="true" 

を追加するために役立つかもしれないことをその正しく問題を理解していればそれは、この内部のようになります。あなたのスニペット:

<com.google.android.maps.MapView 
    android:id="@+id/mapview" 
       android:layout_width="fill_parent" 
       android:layout_height="wrap_content" 
       android:apiKey="0PmsmqKFKflNmHXD2fwG_vPWnR2gA-YB2QVlIQA" 
       android:layout_weight="2" 
       android:enabled="true" 
       android:clickable="true" 
       /> 

MapViewオブジェクトでXMLの2行を追加してみてください。これはうまくいくはずです。我々はアンドロイドに変更した場合、デフォルトでは変更さ

関連する問題