Issue
https://www.project-respite.com/lottie-xamarin-forms/
I don't know what I'm doing wrong. I followed the steps on the tutorial, but I am getting this error "View does not contain the definition of 'AddAnimationListner'..."
I've tried using these [1]classes as well: addAnimatorUpdateListener and addAnimationListner.
What can I do to fix it?
Code: screenshot https://imgur.com/a/02KDU9w
using Android.Animation;
using Android.App;
using Android.Content;
using Android.OS;
using Lottie.Forms.Droid;
using Com.Airbnb.Lottie;
namespace RefrigerantID.Droid
{
[Activity(Theme = "@style/Theme.Splash",
MainLauncher = true,
NoHistory = true)]
public class SplashActivity : Activity, Animator.IAnimatorListener
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
SetContentView(Resource.Layout.splash);
var animationView = FindViewById(Resource.Id.animation_view);
animationView.AddAnimationListener(this);
}
public void OnAnimationCancel(Animator animation)
{
}
public void OnAnimationEnd(Animator animation)
{
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
}
public void OnAnimationRepeat(Animator animation)
{
}
public void OnAnimationStart(Animator animation)
{
}
}
}
Solution
What about...
var animationView = FindViewById<LottieAnimationView>(Resource.Id.animation_view);
animationView.AddAnimationListener(this);
Answered By - Elton Garcia de Santana
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.