2013-04-23 53 views
3
<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> 

这是我的XML文件。 所以当我点击地图时,水平移动意味着从左到右。有没有办法在ScrollView中双向滚动MapView? 我该怎么做? 在此先感谢....当我把地图放在Scrollview中时,它会水平移动但不能垂直移动

+0

嘿,你有没有解决这个问题的方法?我也有同样的问题。请帮助我。 – Noundla 2013-05-09 13:30:06

+0

不..仍然现在我没有找到任何解决方案,这个问题.. – Lawrance 2013-05-10 08:43:27

+0

试试这个: http://stackoverflow.com/questions/6546108/mapview-inside-a-scrollview – kupsef 2014-01-15 12:06:17

回答

0

试试这个:

<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> 
+1

实际上,我在该布局和布局MapView底部显示了大量数据。所以我必须强制把ScrollView作为最顶级的布局..所以这是问题安迪。 – Lawrance 2013-04-23 09:09:36

+0

@Dhruv评论与我的问题相同。 – Noundla 2013-05-09 13:30:49