c# - 使用 Xamarin ImageSource.FromUri ("https://my image url")如何判断是否已检索到图像

标签 c# xaml xamarin xamarin.forms imagesource

我正在使用 ImageSource.FromUri(new Uri("https://my image uri") 并且效果很好。

但是如何判断我是否已成功检索图像?

当我提供一个不存在的 URI 时,我没有收到任何错误并且 FromUri() 返回一个 UriImageSource 但没有图像也没有异常。

最佳答案

看看答案here 我在 Android 上试过,它运行良好。

Quote

1 - Have a look at FFImageLoading Plugin, It provides all you need and more

2- Specifically the ErrorPlaceholder property is what you are looking for. Here you can provide an image which is shown when an error occurs!

关于c# - 使用 Xamarin ImageSource.FromUri ("https://my image url")如何判断是否已检索到图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58033812/

相关文章:

c# - 如何浏览主机上的所有 WCF 服务?

c# - Html.DisplayNameFor() 使用动态计算的属性

c# - TextBlock.Text 更新 ViewModel 和 CodeBehind WPF

c# - 无法在窗口上设置自定义位置

sqlite - Xamarin Sqlite Insert 不返回最后一个主键 ID

c# - 与 ICommand 的 WPF 绑定(bind)错误

c# - 在名称中必须指定过程的所有者 - sql

c# - Xamarin CollectionView 与 Horizo​​ntalItemSpacing 相等的项目宽度

c# - xamarin.forms 中的页面生命周期事件

ios - ListView 中的 ImageView 在启用 RecycleElement 的情况下在滚动条上简要显示上一张图像