void SetStatusBarStyle(StatusBarStyle statusBarStyle) { switch (statusBarStyle) { case StatusBarStyle.DarkText: UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.DarkContent, true); UIApplication.SharedApplication.SetStatusBarHidden(false, true); break; case StatusBarStyle.WhiteText: UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.LightContent, true); UIApplication.SharedApplication.SetStatusBarHidden(false, true); break; case StatusBarStyle.Hidden: UIApplication.SharedApplication.SetStatusBarHidden(true, true); break; case StatusBarStyle.Default: default: UIApplication.SharedApplication.SetStatusBarStyle(UIStatusBarStyle.Default, true); UIApplication.SharedApplication.SetStatusBarHidden(false, true); break; } SetNeedsStatusBarAppearanceUpdate(); }
/// <summary> /// Sets the visual style for the status bar. /// </summary> /// <param name="statusBarStyle">The status bar style.</param> public void SetStatusBarStyle(StatusBarStyle statusBarStyle) { UIStatusBarStyle status = UIStatusBarStyle.Default; if (statusBarStyle == StatusBarStyle.Light) { status = UIStatusBarStyle.LightContent; } UIApplication.SharedApplication.SetStatusBarStyle(status, true); }
static void SetStyle(StatusBarStyle style) { var foregroundColor = style switch { StatusBarStyle.LightContent => Color.White.ToWindowsColor(), StatusBarStyle.DarkContent => Color.Black.ToWindowsColor(), _ => Color.Default.ToWindowsColor(), }; UpdateStatusBar(tb => tb.ForegroundColor = foregroundColor); }
static void SetStyle(StatusBarStyle style) { var uiStyle = style switch { StatusBarStyle.LightContent => UIStatusBarStyle.LightContent, StatusBarStyle.DarkContent => UIStatusBarStyle.DarkContent, _ => UIStatusBarStyle.Default }; UIApplication.SharedApplication.SetStatusBarStyle(uiStyle, false); UpdateStatusBarAppearance(); }
void SetStyle(StatusBarStyle style) { if (!BarStyle.IsSupported()) { return; } switch (style) { case StatusBarStyle.DarkContent: BarStyle.AddBarAppearanceFlag(Activity, (StatusBarVisibility)SystemUiFlags.LightStatusBar); break; default: BarStyle.RemoveBarAppearanceFlag(Activity, (StatusBarVisibility)SystemUiFlags.LightStatusBar); break; } }
public static IPlatformElementConfiguration <iOS, Page> SetStatusBarStyle(this IPlatformElementConfiguration <iOS, Page> config, StatusBarStyle value) { SetStatusBarStyle(config.Element, value); return(config); }
public static void SetStatusBarStyle(BindableObject page, StatusBarStyle value) => page.SetValue(StatusBarStyleProperty, value);
public static Task SetStyle(StatusBarStyle style) => JSRuntime.Current.InvokeAsync <object>(StatusBarSetStyleFunctionName, style);
/// <summary> /// Sets the visual style for the status bar. /// </summary> /// <param name="statusBarStyle">The status bar style.</param> public void SetStatusBarStyle(StatusBarStyle statusBarStyle) { this.ApplicationHost.StatusBar.SetStatusBarStyle(statusBarStyle); }