c# - 缺少手机状态栏

标签 c# xaml mobile uwp .net-core

我正在使用 UWP .net 核心。 该应用程序在桌面上看起来不错,但在移动设备上有一个白色条纹而不是状态栏。

我读了一篇关于

StatusBar.GetForCurrentView().BackgroundColor = Colors.Black;
StatusBar.GetForCurrentView().BackgroundOpacity = 1; 

但是 Visual Studio 找不到“StatusBar”。 我能做些什么?

谢谢

最佳答案

您需要将 Windows Mobile Extension SDK 添加到您的项目中,因为这仅适用于移动设备。

右键点击你的项目,去

Add > Reference...

Reference Manager 窗口弹出时,选择

Universal Windows > Extensions

在左 Pane 中,然后选择具有目标版本的 SDK。

enter image description here

关于c# - 缺少手机状态栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45801052/

相关文章:

c# - 如何获取导致异常的方法的名称

wpf - 有没有一种简单的方法在xaml中指定int值

android - Flutter build apk - 请更新您的 settings.gradle 文件

android - 在 Flutter 中将行和列与溢出的长文本对齐

c# - ASP.NET Identity 2 记住我 - 用户正在注销

c# - 如何在 app.config 中指定类的类型?

c# - 重写继承方法时避免显式类型转换

c# - ListView SelectedItem 的属性和 TextBox 绑定(bind)发生 ArgumentException

wpf - 如何根据资源字典中的另一种样式创建样式?

android - CSS "display:block"不适用于 Chrome for Android