开发者

Create a slideshow with ImageViewe - Android

开发者 https://www.devze.com 2023-04-08 04:14 出处:网络
I need to know how to create a slideshow of images using a ImageView, the names of image files are loaded from an array. So far I have tried this:

I need to know how to create a slideshow of images using a ImageView, the names of image files are loaded from an array. So far I have tried this:

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

imgView.setImag开发者_如何学编程eBitmap(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);

}

But only managed to load the last image of the array, not seeing themselves full animation.

Thanks for the help.


You should use Gallery Wigdet for this particular project.

0

精彩评论

暂无评论...
验证码 换一张
取 消