C# 更改状态栏内容UWP mobile
我想更改手机上的状态栏我想隐藏网络和wifi并保持时钟,更改状态背景颜色并在其上添加文本。。 我已经在Mspoweruser应用程序上看到了这一点,但我不知道怎么做。我找到了一个代码,这就是让我的应用程序全屏运行的代码,但我想保持应用程序的时钟 这是我的密码C# 更改状态栏内容UWP mobile,c#,uwp,C#,Uwp,我想更改手机上的状态栏我想隐藏网络和wifi并保持时钟,更改状态背景颜色并在其上添加文本。。 我已经在Mspoweruser应用程序上看到了这一点,但我不知道怎么做。我找到了一个代码,这就是让我的应用程序全屏运行的代码,但我想保持应用程序的时钟 这是我的密码 ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen; 这是Mspoweruser应用程序状态栏中的图片 您可以隐藏状
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
这是Mspoweruser应用程序状态栏中的图片
您可以隐藏状态栏并创建自己的时间控件
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
}
您可以隐藏状态栏并创建自己的时间控件
if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();
}
他们用
StatusBarProgressIndicator
实现了这一目标。有了这个,你不必自己创建时钟
我自己还没有测试过,但应该可以:
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
StatusBar statusBar = StatusBar.GetForCurrentView();
statusBar.ForegroundColor = YourForegroundColor;
statusBar.BackgroundColor = YourBackgroundColor;
statusBar.BackgroundOpacity = 1.0;
StatusBarProgressIndicator indicator = statusBar.ProgressIndicator;
indicator.ProgressValue = null; // May not be needed, depends on its default value
indicator.Text = "Some text shown in status bar";
await indicator.ShowAsync();
}
他们用
StatusBarProgressIndicator
实现了这一目标。有了这个,你不必自己创建时钟
我自己还没有测试过,但应该可以:
if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
{
StatusBar statusBar = StatusBar.GetForCurrentView();
statusBar.ForegroundColor = YourForegroundColor;
statusBar.BackgroundColor = YourBackgroundColor;
statusBar.BackgroundOpacity = 1.0;
StatusBarProgressIndicator indicator = statusBar.ProgressIndicator;
indicator.ProgressValue = null; // May not be needed, depends on its default value
indicator.Text = "Some text shown in status bar";
await indicator.ShowAsync();
}
谢谢你帮助希望有另一个解决办法谢谢你帮助希望有另一个解决办法