【问题标题】:Color of status bar - Windows 10 Mobile状态栏颜色 - Windows 10 Mobile
【发布时间】:2017-10-07 16:00:54
【问题描述】:

我正在开发一个 uwp 应用程序,我正在使用 template10。在模板 10 中,可以选择深色主题或浅色主题。当我选择深色主题时,Windows 10 Mobile 的状态栏是黑色的(到目前为止还不错),但是当我选择浅色主题时,状态栏是白色的。选择浅色主题时,我希望状态栏为黑色(与深色主题一样)。有可能吗?

【问题讨论】:

    标签: c# uwp windows-10-mobile template10


    【解决方案1】:

    您可以使用以下代码设置状态栏的颜色:

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

    【讨论】:

    • 确保添加对 UWP 的 Windows Mobile Extensions 的引用,上面的代码将为您完成。
    • 不幸的是它没有:(应该是因为我使用的是 Template10
    【解决方案2】:

    不幸的是它没有:(应该是因为我使用的是 Template10

    模板 10 不应影响状态栏。请将状态栏的BackgroundOpacity 设置为1 并重新测试。

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

    【讨论】:

      猜你喜欢
      • 2015-11-27
      • 2020-01-03
      • 2019-11-25
      • 2015-11-20
      • 2011-08-13
      • 2021-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多