缺少移动状态栏

时间:2017-08-21 15:40:45

标签: c# xaml mobile uwp .net-core

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

我读了一篇关于

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

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

谢谢

1 个答案:

答案 0 :(得分:6)

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

右键单击您的项目,转到

  

添加> 参考...

当弹出参考管理器窗口时,选择

  

通用Windows > 扩展程序

在左窗格中

,然后选择包含您要定位的版本的SDK。

enter image description here