Windows通用菜单栏颜色

时间:2015-08-25 20:40:54

标签: statusbar win-universal-app menubar

我查看了Windows Universal Apps文档,但还没找到。如何更改Universal Apps上的菜单栏颜色?

示例:Windows 10 Mail App上的深蓝色MenuBar

1 个答案:

答案 0 :(得分: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 };
}

enter image description here