问题
I'm using xamarin forms V3.4.0.1029999
I have a listview that it contains Image control.
I Pass image source by an string Property. sometimes listview wont show image By URL. i mean for example it shows 39 items but 2.
Sometimes it wont load image from URL. what should i do to always load image?
回答1:
I would suggest you use FFImageLoading's CachedImage for this.
It is a library that is vastly accepted by the community and is great with caching and has memory handling options as well.
You can check their Git wiki to understand the library in depth.
Download it form Nuget
Call CachedImageRenderer.Init()
on each platform. Let’s put it on MainActivity.cs
of our Android project and AppDelegate.cs
of iOS.
Then add its namespace and use it like this:
<ffimageloading:CachedImage
HorizontalOptions="Center" VerticalOptions="Center"
DownsampleToViewSize="true"
Source = "{Binding ImageUrl}">
</ffimageloading:CachedImage>
来源:https://stackoverflow.com/questions/54647346/xamarin-forms-image-not-showing-image-in-listview-by-url-sometimes