【问题标题】:How to display gif image in Xamarin form?如何以 Xamarin 形式显示 gif 图像?
【发布时间】:2020-05-07 18:17:14
【问题描述】:

我有一个 gif 图像,我想在屏幕应用程序上显示它。我使用库 FFImageLoading 加载 gif 图像,但我无法在 xamarin.forms 3.1 中显示它。 不知道其他库是否支持加载gif图片? 请帮我! 谢谢!

【问题讨论】:

标签: c# .net xamarin xamarin.forms


【解决方案1】:

FFImageLoading.Svg.Forms 支持 gif 图像。我使用 FFImageLoading 显示 gif 没有问题。

<ContentView xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"  x:Class="MyApp.AnimationView" 
         xmlns:ffimageloading="clr-namespace:FFImageLoading.Svg.Forms;assembly=FFImageLoading.Svg.Forms">

    <ffimageloading:SvgCachedImage HeightRequest="30" HorizontalOptions="FillAndExpand" VerticalOptions="Center" Aspect="AspectFill" x:Name="imageWave" Source="Wave.gif" Margin="0"/>

</ContentView>

如果您需要更多信息,请告诉我。

【讨论】:

  • 谢谢!我添加了错误的路径“源”图像...我修复了它。
  • 在 UWP Gif 中对我不起作用,在 android 和 ios 上运行良好。 UWP 中还有什么添加的吗?
猜你喜欢
  • 1970-01-01
  • 2018-06-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-11-24
  • 1970-01-01
相关资源
最近更新 更多