2011-10-15 5 views
0

안녕하세요, 올바르게 표시되는 내 application.it에서 mapview를 사용하고 있습니다.하지만 문제는 터치 한지도보기가 사용자가 주변 위치를보고 싶을 때 이동하지 않는다는 것입니다. 당신은 그 위치로 이동할 수 있습니다. 어떤 뷰가 어떤 위치가 하나가 이동하고 무엇을하지 이유를 알려 주시기 바랍니다 수 있습니다 기본적으로 터치 때 그지도보기 내 layout.here에 touchevent에 응답하지 않는 말할 수있는 것은 다른 위치로 이동 내 레이아웃 코드안드로이드에서 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

지도보기 우리는 안드로이드에서 변경 될 때 기본적으로 변경? –

답변

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 내부에 두 줄을 추가하면 제대로 작동합니다.