我FFImageLoading
用于在我的项目中播放 gif 文件。它在 android 和 ios 上运行良好,但在 UWP 中无法运行。
我已将以下 NuGet 包添加到我的解决方案中的每个项目。
Xamarin.FFImageLoading。
Xamarin.FFImageLoading.Forms。
Xamarin.FFImageLoading.Transformations。
Xamarin.FFImageLoading.Svg。
Xamarin.FFImageLoading.Svg.Forms。
在 UWP 上添加了以下代码MainPage.xaml.cs
:
FFImageLoading.Forms.Platform.CachedImageRenderer.Init();
在 XAML 中:
xmlns:ffimageloading="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms"
<ffimageloading:SvgCachedImage
HorizontalOptions="CenterAndExpand"
x:Name="GifImage"
Grid.Row="0"
VerticalOptions="CenterAndExpand"
WidthRequest="200"
HeightRequest="200"
Source="ic_dove_loading_xx.gif"/>
Gif 未在 UWP 应用中播放。UWP 的 Windows 部分是否有任何其他设置?