更改状态栏内容uwp [英] Change status bar content uwp

查看:89
本文介绍了更改状态栏内容uwp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Windows 10手机上更改状态栏的内容我想添加文字并删除一些图标

I want to change the content for my status bar on windows 10 mobile i want to add a text and remove some icons

我只能找到一个改变颜色和前景色的代码...

I can only find a codes for change back color and foreground color ...

这是我的代码

         if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
            {
                var statusBar = StatusBar.GetForCurrentView();
                if (statusBar != null)
                {
                    statusBar.BackgroundOpacity = 1;
                    statusBar.BackgroundColor = (Color)this.Resources["SystemAccentColor"];
                    statusBar.ForegroundColor = Colors.White;
                }

推荐答案

您可以添加将显示的文本而不是大多数图标:

You can add text which will then be shown instead of most icons:

StatusBarProgressIndicator indicator = StatusBar.GetForCurrentView().ProgressIndicator;
indicator.ProgressValue = 0.5;
indicator.Text = "Your text";
await indicator.ShowAsync();


这篇关于更改状态栏内容uwp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆