【问题标题】:Adding an image for faild downloads in universal image loader在通用图像加载器中为失败的下载添加图像
【发布时间】:2012-12-03 23:58:42
【问题描述】:

在我的 monodroid 应用程序中,我使用通用图像加载器在列表视图中显示图像。 在显示图像之前,我会在图像上显示一个进度条。 我想在下载失败时添加默认图像。 可能吗? 这是我用它显示图像的代码:

    ImageLoader = Com.Nostra13.Universalimageloader.Core.ImageLoader.Instance;
ImageLoader.DisplayImage(myobject.Images [0], imageView,  Application.Options, newImageLoaderListener (progressbar));

这是一个 monodroid 代码。 谢谢。

【问题讨论】:

  • 是的,有可能,如果下载失败,你应该有某种标志或触发器来识别失败的图像,然后显示你的默认图像。
  • 如何检测下载失败?
  • IF下载位图后,downloadBitmap == null?错误:成功。类似情况
  • 我只是使用通用图像加载器的显示图像功能以及该库本身完成的所有其他事情。因此,当我将图像视图传递给图像加载器的显示功能时,如何检测位图何时为空
  • 你能显示你实际设置ImageViews Bitmap的代码吗?

标签: android android-listview xamarin.android universal-image-loader


【解决方案1】:

为此使用ImageLoadingListener.onLoadingFailed()。在onLoadingFailed() 中显示您的图像。

【讨论】:

    猜你喜欢
    • 2013-06-15
    • 2014-08-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-13
    • 2012-12-01
    • 2013-09-16
    • 2017-04-07
    相关资源
    最近更新 更多