2012-11-19 52 views
0

我想實現的東西在ImageView的圖像之間進行切換,就像一個圖片庫。更改ImageView的圖片用手勢

我有這樣的XML展現的ImageView

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 
    <HorizontalScrollView 
      android:id="@+id/hsv_ScrollImage" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:scrollbars="none"> 
      <ImageView 
       android:id="@+id/id_imgFinal" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content"/>  
     </HorizontalScrollView>  
</LinearLayout> 

我的應用程序顯示的圖像,是在橫向模式,這是我使用的Horizo​​ntalScrollView的原因。現在我遇到了這個問題,我會嘗試使用某種手勢實現某些功能以更改爲其他圖像,但是我不知道Horizo​​ntalScrollView是否是此問題。有人可以幫助我嗎?哪種方法最常用於此活動?

謝謝。

回答

0

Here有一個很好的教程與ViewPager。您甚至可以與Gesture-ImageView進行整合,以便爲圖庫添加縮放功能。

啊!不要忘記將this patch添加到Gesture-ImageView以更好地集成。