我看到我们使用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实例,用CachedImage替换了Android项目中的ImageView实例。
但是在阅读了FFImageLoading文档之后,我还看到了许多使用ImageService加载图像的案例。例如:
ImageService.Instance.LoadUrl(urlToImage).Into(_imageView);
ImageService.Instance.LoadCompiledResource(nameOfResource).Into(_imageView);
...发布于 2017-09-26 13:14:39
FFImageLoading是一个多平台库.ImageService.Instance方法用于将图像加载到本地视图中(比如ImageViewAsync在Android上或UIImageView在iOS上),也用于一些高级场景。还有一些特定于平台的控件在内部使用这些方法,例如:
CachedImage for Xamarin.FormsMvxCachedImageView他们允许你使用像绑定之类的东西。
我建议您使用特定于平台的控件,并对高级事物使用ImageService.Instance调用。但这完全取决于你。
https://stackoverflow.com/questions/46411730
复制相似问题