2011-09-26 56 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。