我在AirBnb的Lottie框架中定义了一个AnimationView
,它应该加载放置在我的Xamarin.Forms项目(便携式项目)内Resource文件夹中的文件。
<forms:AnimationView
x:Name="AnimationView"
Animation="SharpLibrary.Forms.Assets.Images.WineGlass.json"
Loop="True"
AutoPlay="True"
VerticalOptions="FillAndExpand"
HorizontalOptions="FillAndExpand" />
但是似乎它无法解析Animation
属性中的字符串,因此不会显示动画。如果我将文件放入资源文件夹并说Animation="WineGlass.json"
,它就可以正常工作。
有没有办法从嵌入式资源中加载它,或者这不可能吗?
Animation="WineGlass"
- FabriBertani