Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to show loading animation in Android imageview?

Tags:

android

Anyone knows how to show the loading animation in ImageView just like the animation in loading dialog box?

I am developing an activity that contains a view flipper. The view flipper contains several imageviews and it allows user to view different images by fling gesture event. All the images will be downloaded from the remote server via async task when the activity is created. I would like to show loading animation in all imageviews that does not contain image.

like image 550
kenn3th Avatar asked Jul 12 '11 07:07

kenn3th


1 Answers

Here's a hint: use FrameLayout with an ImageView on background and a spinner Progress Bar on foreground. While the image is being loaded you can show the spinning Progress Bar, and when the image is loaded just make this Progress Bar invisible. Hope this helps.

like image 196
Egor Avatar answered Oct 09 '22 11:10

Egor