像这里所说的那样创建了简单的动画:https ://docs.microsoft.com/en-us/windows/communitytoolkit/animations/lottie-scenarios/getting_started_json
<controls:AnimatedVisualPlayer AutoPlay="True" Width="90" Height="90">
<lottie:LottieVisualSource UriSource="ms-appx:///Utils/17477-orange-payment.json"/>
<controls:AnimatedVisualPlayer>
它适用于 UWP,不适用于 Android。
我引用的内容:
UWP
<PackageReference Include="Microsoft.Extensions.Logging.Console">
<Version>1.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Filter">
<Version>1.1.2</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.10</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Lottie">
<Version>6.0.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.3.200213001</Version>
</PackageReference>
<PackageReference Include="Uno.Microsoft.Toolkit.Uwp.UI">
<Version>5.1.0-build.200.gf9c311b069</Version>
</PackageReference>
<PackageReference Include="Uno.UI">
<Version>2.1.37</Version>
</PackageReference>
Android
<PackageReference Include="Com.Airbnb.Android.Lottie">
<Version>3.0.4</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.3.200213001</Version>
</PackageReference>
<PackageReference Include="Uno.Microsoft.Toolkit.Uwp.UI">
<Version>5.1.0-build.200.gf9c311b069</Version>
</PackageReference>
<PackageReference Include="Uno.UI" Version="2.2.0-dev.390" />
<PackageReference Include="Uno.UI.Lottie">
<Version>2.2.0-dev.390</Version>
</PackageReference>
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.2" />
该应用程序在没有 的情况下运行NotImplementedException
,在 Android 上只是透明的。任何样品都会很棒!