[英]How to wait for lottie animation to finish then do something
我正在學習 Xamarin.Forms
一旦我的 Lottie Anymation 玩完,我想繼續一些動作
這是我的 xaml 代碼:
<forms:AnimationView Grid.Column="1" IsVisible="False"
x:Name="MyYesAddWordAnim"
Animation="YesAddAnim.json"
RepeatMode="Infinite"
HeightRequest="40"
WidthRequest="40"
VerticalOptions="FillAndExpand"
HorizontalOptions="CenterAndExpand"
ClassId="2">
</forms:AnimationView>
這是我的代碼:
void OnYesAddWord()
{
//start my animation
MyYesAddWordAnim.IsVisible = true;
MyYesAddWordAnim.PlayAnimation();
//Do something here
//Wait for animation finished then Hide my animation
MyYesAddWordAnim.IsVisible = true;
}
感謝您的幫助
如果您查看文檔, AnimationView
有一個OnFinishedAnimation
事件處理程序
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.