4
<ScrollView  
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" > 
            <LinearLayout
                android:id="@+id/below_layout_1"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/layout_background" >
                <com.google.android.maps.MapView
                    android:id="@+id/mpDelivery"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                   android:clickable="true" >
                </com.google.android.maps.MapView>
                <LinearLayout
                    android:id="@+id/zoom"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentBottom="true"
                    android:layout_centerHorizontal="true" >
                </LinearLayout>
            </LinearLayout></ScrollView>

Here is my XML File. So when i click on the map, it moves horizontally means left to right. Is there a way to move the MapView in both direction scrolling inside the ScrollView ? How can i do that? Thanks in Advance....

Josh Crozier
  • 233,099
  • 56
  • 391
  • 304
Dhruv
  • 1,862
  • 3
  • 20
  • 38

2 Answers2

1

Other solutions from this site:

MapView inside a ScrollView?

ScrollView is catching touch event for google map

And for android map v2, follow this solution

Community
  • 1
  • 1
Lorensius W. L. T
  • 1,734
  • 4
  • 19
  • 31
0

Try this:

 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bg" >

    <FrameLayout
        android:id="@+id/below_layout_1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

         <com.google.android.maps.MapView
                    android:id="@+id/mpDelivery"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                   android:clickable="true" >
                </com.google.android.maps.MapView>
        <LinearLayout
            android:id="@+id/zoom"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:gravity="center" >
        </LinearLayout>
    </FrameLayout>

</RelativeLayout>
Andy
  • 47
  • 3