【发布时间】:2015-09-30 22:10:10
【问题描述】:
我有一个列表,其中显示文本、图像和 4 个选项(A、B、C、D)
我正在使用通用图像加载器来处理图像,我的要求是我必须在下载后将出现的图像精确大小的位置显示一个小的动画进度条,
任何人都可以建议我如何实现这一目标,我正在为此苦苦挣扎。慢慢学习android UI。请帮帮我
以下是参考代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:textColor="#d9000000"
android:textSize="20sp"
android:textStyle="bold"
/>
<TextView
android:id="@+id/body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:lineSpacingMultiplier="1.4"
android:maxLines="4"
android:textColor="#d9000000"
android:textSize="16sp"
/>
<ImageView
android:id="@+id/image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
/>
</LinearLayout>
并在列表适配器中使用以下代码上传图片
mDisplayImageOptions = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(true)
.build();
mImageLoader.displayImage(url, mImageView, mDisplayImageOptions);
我已经检查了下面的链接,但没有工作
Show indeterminate ProgressBar while loading image with Universal Image Loader
【问题讨论】:
标签: android android-imageview universal-image-loader