我正在尝试使用以下代码从 View 构造函数中检索 StatusBar 对象:
bool mobile = Windows.Foundation.Metadata.ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract",1,0);
如果(手机){
var statusbar = Windows.UI.ViewManagement.StatusBar.GetForCurrentView();
}
使用 Visual Studio Community 2015,我收到以下错误:
错误 CS0731 程序集“Windows”中类型“Windows.UI.ViewManagement.StatusBar”的类型转发器导致循环
错误 CS1069 在命名空间“Windows.UI.ViewManagement”中找不到类型名称“StatusBar”。此类型已转发到程序集“Windows,Version=255.255.255.255,Culture=neutral,PublicKeyToken=null,ContentType=WindowsRuntime”考虑添加对该程序集的引用。
根据 Microsoft ,这个类应该存在。我什至为移动设备系列添加了对 Package.appxmanifest 的依赖,但仍然没有。有什么想法吗?
最佳答案
关于c# - 在 Windows Universal App 中使用 StatusBar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32725185/