protected override void OnAttached()
        {
            var    backgroundColor = StatusBarEffect.GetBackgroundColor().ToAndroid();
            Window window          = Globals.Window;

            window.SetStatusBarColor(backgroundColor);
        }
Ejemplo n.º 2
0
        protected override void OnAttached()
        {
            var backgroundColor = StatusBarEffect.GetBackgroundColor();

            var alpha = backgroundColor.A * 255;
            var red   = backgroundColor.R * 255;
            var green = backgroundColor.G * 255;
            var blue  = backgroundColor.B * 255;
            var statusBackgroundColor = Windows.UI.Color.FromArgb((byte)alpha, (byte)red, (byte)green, (byte)blue);

            //if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView"))
            //{
            //    var titleBar = ApplicationView.GetForCurrentView().TitleBar;
            //    if (titleBar != null)
            //    {
            //        titleBar.ButtonBackgroundColor = Colors.DarkBlue;
            //        titleBar.ButtonForegroundColor = Colors.White;
            //        titleBar.BackgroundColor = Colors.Blue;
            //        titleBar.ForegroundColor = Colors.White;
            //    }
            //}

            if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                var statusBar = StatusBar.GetForCurrentView();
                if (statusBar != null)
                {
                    statusBar.BackgroundOpacity = 1;
                    statusBar.BackgroundColor   = statusBackgroundColor;
                }
            }
        }
Ejemplo n.º 3
0
        protected override void OnAttached()
        {
            UIView statusBar = UIApplication.SharedApplication.ValueForKey(new NSString("statusBar")) as UIView;

            if (statusBar.RespondsToSelector(new ObjCRuntime.Selector("setBackgroundColor:")))
            {
                statusBar.BackgroundColor = StatusBarEffect.GetBackgroundColor().ToUIColor();
            }
        }
Ejemplo n.º 4
0
        protected override void OnAttached()
        {
            var frame = UIApplication.SharedApplication.KeyWindow?.WindowScene?.StatusBarManager.StatusBarFrame;

            if (frame.HasValue)
            {
                var statusBar = new UIView(frame.Value);
                statusBar.BackgroundColor = StatusBarEffect.GetBackgroundColor().ToUIColor();
                UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent;
                UIApplication.SharedApplication.KeyWindow?.AddSubview(statusBar);
            }
        }
Ejemplo n.º 5
0
 protected override void OnElementPropertyChanged(PropertyChangedEventArgs args)
 {
     base.OnElementPropertyChanged(args);
     if (args.PropertyName == StatusBarEffect.ColorProperty.PropertyName)
     {
         SetColor(StatusBarEffect.GetColor(Element));
     }
     else if (args.PropertyName == StatusBarEffect.StyleProperty.PropertyName)
     {
         SetStyle(StatusBarEffect.GetStyle(Element));
     }
 }
Ejemplo n.º 6
0
 protected override void OnAttached()
 {
     SetColor(StatusBarEffect.GetColor(Element));
     SetStyle(StatusBarEffect.GetStyle(Element));
 }
Ejemplo n.º 7
0
 protected override void OnAppearing()
 {
     base.OnAppearing();
     StatusBarEffect.SetBackgroundColor(Color.Red);
     Effects.Add(new StatusBarEffect());
 }
Ejemplo n.º 8
0
 public MainPage()
 {
     InitializeComponent();
     StatusBarEffect.SetBackgroundColor(Color.FromHex("232222"));
     this.Effects.Add(new StatusBarEffect());
 }