protected override void OnAttached() { var backgroundColor = StatusBarEffect.GetBackgroundColor().ToAndroid(); Window window = Globals.Window; window.SetStatusBarColor(backgroundColor); }
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; } } }
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(); } }
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); } }
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)); } }
protected override void OnAttached() { SetColor(StatusBarEffect.GetColor(Element)); SetStyle(StatusBarEffect.GetStyle(Element)); }
protected override void OnAppearing() { base.OnAppearing(); StatusBarEffect.SetBackgroundColor(Color.Red); Effects.Add(new StatusBarEffect()); }
public MainPage() { InitializeComponent(); StatusBarEffect.SetBackgroundColor(Color.FromHex("232222")); this.Effects.Add(new StatusBarEffect()); }