简体   繁体   中英

How to wait for lottie animation to finish then do something

I am learning Xamarin.Forms

I would like to continue some action once my Lottie Anymation finish to play

Here is my xaml code :

 <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>

Here is my code :

 void OnYesAddWord()
    {

        //start my animation
        MyYesAddWordAnim.IsVisible = true;
        MyYesAddWordAnim.PlayAnimation();


        //Do something here 


        //Wait for animation finished then Hide my animation
        MyYesAddWordAnim.IsVisible = true;


    }

thanks for your help

如果您查看文档AnimationView有一个OnFinishedAnimation事件处理程序

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM