2011-09-26 53 views
0

我需要知道如何使用ImageView創建圖像幻燈片,圖像文件的名稱是從數組中加載的。到目前爲止,我已經試過這樣:使用ImageViewe創建幻燈片 - Android

for(i=0;i<bL.length;i++){ 

imgView.setImageBitmap(bitmap); 
a = new TranslateAnimation(
         Animation.RELATIVE_TO_PARENT, +1.0f, 
         Animation.RELATIVE_TO_PARENT, 0.0f, 
         Animation.RELATIVE_TO_PARENT, 0.0f, 
         Animation.RELATIVE_TO_PARENT, 0.0f); 
a.setDuration(5000); 

imgView.startAnimation(a); 

} 

但只有管理加載數組的最後一個圖像,沒有看到自己完整的動畫。

感謝您的幫助。

+0

你看過圖庫小部件嗎? – JesusFreke

+0

imageview一次只能保存一張圖片!這樣的答案可能會有所幫助 - http://stackoverflow.com/questions/3373536/using-the-android-gallery-as-an-automated-slideshow/3376203#3376203 – Raunak

+0

正試圖不斷滑動一組圖像? – blessenm

回答

0

您應該對這個特定的項目使用Gallery Wigdet。