[英]Why does my lottie animation doesn't show in Xamarin Forms?
我遵循了一个教程,由于某种原因,我在 Android 设备上测试时没有显示我的抽签动画。
包 Com.Airbnb.Lottie.Forms 被添加到所有应用程序项目(它是跨平台的)然后将 Com.Airbnb.Android.Lottie 添加到 Android 应用程序(首先我尝试没有它,也没有工作)
这是代码
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:lottie="clr-namespace:Lottie.Forms;assembly=Lottie.Forms"
x:Class="AppWasher.MainPage">
<StackLayout>
<lottie:AnimationView
x:Name="animationView"
Animation="26617-ogad.json"
RepeatMode="Restart"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand"
WidthRequest="300"
HeightRequest="300"/>
</StackLayout>
</ContentPage>
这是乐天提供的指南
<forms:AnimationView
x:Name="animationView"
Animation="LottieLogo1.json"
AnimationSource="AssetOrBundle"
Command="{Binding ClickCommand}"
RepeatCount="3"
RepeatMode="Restart"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand" />
我也尝试使用所有这些属性,结果相同。
我正在测试Android 9.0版本
我目前正在努力将 lottie 添加到我在 Visual Studio 中的 android xamarin 应用程序中。
大多数教程都讨论了可以在资源下找到的本机布局文件夹。 我找不到这个文件夹(也试过,全部显示)并自己添加。 重建解决方案,但它不想绑定到 resource.layout。
你在哪里找到你的教程,你是否也尝试过制作动画闪屏?
提前致谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.