2011-09-02 113 views
2

我想在android中創建滑動圖像ImageView。當我 移動手指右側比當前圖像移動右側和 下一個圖像顯示。當我向上,向下,向左移動手指 時,完成同樣的事情。我有一個圖像陣列。在那許多圖像有... 一個接一個我希望在幻燈片中的所有圖像...我嘗試很多代碼但不是 得到適當的輸出... 在我的代碼中只有1 ImageView 可以任何一個幫助我.....我 試試這個鏈接也只是可能沒有得到適當的幫助Android圖像滑動圖像

sliding between images android

由於提前

回答

4

然後你正在尋找viewflippers。

這些可以幫助你上手,

http://saigeethamn.blogspot.com/2010/05/image-switcher-view-android-developer.html

http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/

http://www.androidguys.com/2008/08/14/flipping-your-views/

http://www.codeshogun.com/blog/2009/04/16/how-to-implement-swipe-action-in-android/

樣品。

<Gallery 
     android:id="@+id/Gallery01" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"></Gallery> <ImageSwitcher 
     android:id="@+id/ImageSwitcher01" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> </ImageSwitcher> 

iSwitcher = (ImageSwitcher) findViewById(R.id.ImageSwitcher01); 
      iSwitcher.setFactory(this); 
      iSwitcher.setInAnimation(AnimationUtils.loadAnimation(this, 
         android.R.anim.fade_in)); 
      iSwitcher.setOutAnimation(AnimationUtils.loadAnimation(this, 
         android.R.anim.fade_out)); 
+0

Thxs您的幫助.... 但我這個嘗試的所有代碼.... 我認爲üCNT理解我的QU .... 我只有一個ImageView的......並且在ImageView的圖像設置Dynamicaly .... –