AppDelegate.cs 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using Foundation;
  2. using System;
  3. using UIKit;
  4. using Xamarin.Forms;
  5. using Xamarin.Forms.Platform.iOS;
  6. namespace MyWeather.iOS
  7. {
  8. // The UIApplicationDelegate for the application. This class is responsible for launching the
  9. // User Interface of the application, as well as listening (and optionally responding) to application events from iOS.
  10. [Register ("AppDelegate")]
  11. public class AppDelegate : FormsApplicationDelegate
  12. {
  13. public override bool FinishedLaunching (UIApplication app, NSDictionary options)
  14. {
  15. UINavigationBar.Appearance.BarTintColor = UIColor.FromRGB(43, 132, 211); //bar background
  16. UINavigationBar.Appearance.TintColor = UIColor.White; //Tint color of button items
  17. UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes()
  18. {
  19. Font = UIFont.FromName("HelveticaNeue-Light", 20f),
  20. TextColor = UIColor.White
  21. });
  22. Forms.Init();
  23. LoadApplication(new App());
  24. return base.FinishedLaunching(app, options);
  25. }
  26. public override void OnResignActivation (UIApplication application)
  27. {
  28. // Invoked when the application is about to move from active to inactive state.
  29. // This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message)
  30. // or when the user quits the application and it begins the transition to the background state.
  31. // Games should use this method to pause the game.
  32. }
  33. public override void DidEnterBackground (UIApplication application)
  34. {
  35. // Use this method to release shared resources, save user data, invalidate timers and store the application state.
  36. // If your application supports background exection this method is called instead of WillTerminate when the user quits.
  37. }
  38. public override void WillEnterForeground (UIApplication application)
  39. {
  40. // Called as part of the transiton from background to active state.
  41. // Here you can undo many of the changes made on entering the background.
  42. }
  43. public override void OnActivated (UIApplication application)
  44. {
  45. // Restart any tasks that were paused (or not yet started) while the application was inactive.
  46. // If the application was previously in the background, optionally refresh the user interface.
  47. }
  48. public override void WillTerminate (UIApplication application)
  49. {
  50. // Called when the application is about to terminate. Save data, if needed. See also DidEnterBackground.
  51. }
  52. }
  53. }