I have a Relative Layout that has two children, an ImageView and a ProgressBar. While the image for the ImageView is loading I want to show the spinning progress bar, and once the image has finished I want to hide the progress bar and show the Image. I can never get the image to show up, but the progress bar shows just fine. I have verified that the image is being loaded, this seems like a layout issue but is beyond me...
this is my layout file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center">
<ImageView
android:layout_width="110dp"
android:layout_height="110dp"
android:visibility="visible"/>
<ProgressBar
android:layout_width="110dp"
android:layout_height="110dp"/>
</RelativeLayout>
When Loading image...
final RelativeLayout relLayout = (RelativeLayout)convertView;
final ImageView imageView = (ImageView)relLayout.getChildAt(0);
final ProgressBar bar = (ProgressBar)relLayout.getChildAt(1);
bar.setIndeterminate(true);
bar.setVisibility(View.VISIBLE);
imageView.setVisibility(View.GONE);
And inside the onSuccess of my imageLoader
bar.setVisibility(View.GONE);
imageView.setVisibility(View.VISIBLE);
imageView.setImageBitmap(resizedBitmap);
relLayout.requestLayout(); // also tried invalidate(), and nothing at all
Help?