2013-04-23 23 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

相關問題