【问题标题】:Windows Universal Menu Bar colorWindows 通用菜单栏颜色
【发布时间】:2015-08-25 20:40:53
【问题描述】:

我查看了 Windows 通用应用程序文档,但没有找到。如何更改通用应用上的菜单栏颜色?

示例:Windows 10 Mail App 上的深蓝色菜单栏

【问题讨论】:

    标签: statusbar win-universal-app menubar


    【解决方案1】:

    在应用启动时更改标题栏的背景颜色。

    代码:

    void InitializeTitleBar()
    {
        var titleBar = ApplicationView.GetForCurrentView().TitleBar;
        // Title bar colors. Alpha must be 255.
        titleBar.BackgroundColor = new Color() { A = 255, R = 22, G = 100, B = 167 };
        titleBar.ForegroundColor = new Color() { A = 255, R = 255, G = 255, B = 255 };
        titleBar.ButtonBackgroundColor = new Color() { A = 255, R = 22, G = 100, B = 167 };
    
        titleBar.ButtonForegroundColor = new Color() { A = 255, R = 255, G = 255, B = 255 };
    }
    

    【讨论】:

      猜你喜欢
      • 2022-01-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-17
      • 2013-08-03
      相关资源
      最近更新 更多