Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 6
0
 public static IPlatformElementConfiguration <iOS, Page> SetStatusBarStyle(this IPlatformElementConfiguration <iOS, Page> config, StatusBarStyle value)
 {
     SetStatusBarStyle(config.Element, value);
     return(config);
 }
Esempio n. 7
0
 public static void SetStatusBarStyle(BindableObject page, StatusBarStyle value) => page.SetValue(StatusBarStyleProperty, value);
 public static Task SetStyle(StatusBarStyle style) =>
 JSRuntime.Current.InvokeAsync <object>(StatusBarSetStyleFunctionName, style);
Esempio n. 9
0
 /// <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);
 }