简体   繁体   English

UWP - 更改后退按钮颜色而不更改最小化/关闭按钮颜色

[英]UWP - Change back button color without changing minimize/close button colors

I am trying to change the background colors of the Title Bar buttons in my app (the Back button and the minimize/expand/close buttons). 我正在尝试更改应用程序中标题栏按钮的背景颜色(“后退”按钮和最小化/展开/关闭按钮)。 Specifically, I want the back button color to be difference from the minimize/expand/close buttons. 具体来说,我希望后退按钮颜色与最小化/扩展/关闭按钮不同。 This code changes both the back button and minimize/expand/close buttons color; 此代码更改后退按钮和最小化/扩展/关闭按钮颜色; How can I change the colors separately from eachother? 如何单独更改颜色?

var titleBar = ApplicationView.GetForCurrentView().TitleBar;

if (titleBar != null)
{
    // I only want to change the back button color here, but this code
    // changes both the back button and resize/close buttons color too
    titleBar.ButtonBackgroundColor = Windows.UI.Colors.DarkBlue;
}

That's not possible unfortunately. 不幸的是,这是不可能的。 You can however extend your app's content to the title bar and then create your own back button.Take a look here . 然而,您可以将应用程序的内容扩展到标题栏,然后创建自己的后退按钮。请在此处查看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM