我看到我们使用FFImageLoading
如下
var cachedImage = new CachedImage() {
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
WidthRequest = 300,
HeightRequest = 300,
...
Source = <url or asset or resource location>
};
或在 XAML 中:
<ffimageloading:CachedImage
HorizontalOptions="Center" VerticalOptions="Center"
WidthRequest="300" HeightRequest="300"
DownsampleToViewSize="true"
Source = "<url or asset or resource location>>
</ffimageloading:CachedImage>
Image
,因此,我将UWP 项目和ImageView
Android 项目中的所有实例替换为CachedImage
.
但是在阅读了 FFImageLoading 文档后,我也看到了很多使用ImageService
. 例如:
ImageService.Instance.LoadUrl(urlToImage).Into(_imageView);
ImageService.Instance.LoadCompiledResource(nameOfResource).Into(_imageView);
...
这两种方式有什么区别?
为什么我要使用其中一个?