https://www.project-respite.com/lottie-xamarin-forms/ を実際にやってみたコード
07jp27 / lottie-splash Goto Github PK
View Code? Open in Web Editor NEWApply Lottie to Splash screen of Xamarin.Forms app
Apply Lottie to Splash screen of Xamarin.Forms app
Hi,
I followed your guide and I have a problem, in the file SplashActivity.cs,
var animationView = FindViewById(Resource.Id.animation_view);
animationView.AddAnimatorListener(this);
Error CS1061 'View' does not contain a definition for 'AddAnimatorListener' and no accessible extension method 'AddAnimatorListener' was found that accepts a first argument of type 'View'. Probably missing a using directive or an assembly reference
Thank you.
Hi,
In my app i used same splash screen . But this screen push notification . Please help me . I am not able to move ahead.
Here is my code.
SplashViewController
public partial class SplashViewController : UIViewController
{
public SplashViewController() : base("SplashViewController", null)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
var animationView = LOTAnimationView.AnimationNamed("loading_gears");
var boundSize = UIScreen.MainScreen.Bounds.Size;
animationView.Frame = new CGRect(x: 0, y: 0, width: boundSize.Width, height: boundSize.Height);
animationView.ContentMode = UIViewContentMode.ScaleAspectFit;
this.View.AddSubview(animationView);
animationView.PlayWithCompletion((animationFinished) =>
{
UIApplication.SharedApplication.Delegate.FinishedLaunching(UIApplication.SharedApplication,
new Foundation.NSDictionary());
});
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
}
}
App delegate:
[Register("AppDelegate")]
public partial class AppDelegate : FormsApplicationDelegate
{
public override UIWindow Window { get; set; }
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 7 seconds to return from this method, or iOS will terminate your application.
//
public SplashViewController initialViewController;
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
{
if (Window == null)
{
Window = new UIWindow(frame: UIScreen.MainScreen.Bounds);
initialViewController= new SplashViewController();
Window.RootViewController = initialViewController;
Window.MakeKeyAndVisible();
return true;
}
else
{
try
{
MessagingCenter.Subscribe<AuthorizationService>(this, "device_token", SetDeviceToken);
Xamarin.Forms.Forms.Init();
//UINavigationBar.Appearance.TintColor = Color.Red.ToUIColor();
CachedImageRenderer.Init();
CarouselViewRenderer.Init();
TintedImageRenderer.Init();
AnimationViewRenderer.Init();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
LoadApplication(new App(new ClickNotificationModel()));
//uiApplication.KeyWindow.TintColor = UIColor.Black;
return base.FinishedLaunching(uiApplication, launchOptions);
}
}
//application:didReceiveRemoteNotification:fetchCompletionHandler
public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, System.Action<UIBackgroundFetchResult> completionHandler)
{
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
var result = Push.DidReceiveRemoteNotification(userInfo);
System.Console.WriteLine(userInfo.ToString());
if (result)
{
completionHandler?.Invoke(UIBackgroundFetchResult.NewData);
}
else
{
completionHandler?.Invoke(UIBackgroundFetchResult.NoData);
}
}
public override void RegisteredForRemoteNotifications(UIApplication application, NSData deviceToken)
{
Push.RegisteredForRemoteNotifications(deviceToken);
}
public override void FailedToRegisterForRemoteNotifications(UIApplication application, NSError error)
{
Push.FailedToRegisterForRemoteNotifications(error);
}
public override void OnActivated(UIApplication uiApplication)
{
base.OnActivated(uiApplication);
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
}
public override void WillEnterForeground(UIApplication uiApplication)
{
base.WillEnterForeground(uiApplication);
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
//Config.ResestBadge();
}
public override void ReceivedRemoteNotification(UIApplication application, NSDictionary userInfo)
{
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0;
base.ReceivedRemoteNotification(application, userInfo);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.