private void SetStatusBarForegroundType(StatusBarForegroundType foregroundType) { if (Android.OS.Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.M) { _foregroundType = foregroundType; UpdateSystemUiVisibility(); } else { this.Log().Warn("The status bar foreground color couldn't be changed. This API is only available starting from Android M (API 23)."); } }
private void SetStatusBarForegroundType(StatusBarForegroundType foregroundType) { switch (foregroundType) { case StatusBarForegroundType.Dark: // The status bar foreground on iOS is dark by default UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.Default; break; case StatusBarForegroundType.Light: UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; break; } }
private void SetStatusBarForegroundType(StatusBarForegroundType foregroundType) { switch (foregroundType) { case StatusBarForegroundType.Dark: // iOS 13 and above requires explicit configuration of darkContent for light backgrounds statusbar // https://developer.apple.com/documentation/uikit/uistatusbarstyle/darkcontent UIApplication.SharedApplication.StatusBarStyle = UIDevice.CurrentDevice.CheckSystemVersion(13, 0) ? UIStatusBarStyle.DarkContent : UIStatusBarStyle.Default; break; case StatusBarForegroundType.Light: UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.LightContent; break; } }