2017-08-04 245 views
1

我想改變我的應用程序中的標題欄按鈕(後退按鈕和最小化/展開/關閉按鈕)的背景顏色。具體來說,我希望後退按鈕的顏色與最小化/展開/關閉按鈕不同。此代碼將更改後退按鈕和最小化/展開/關閉按鈕顏色;我怎樣才能從彼此分開改變顏色?UWP - 改變後退按鈕顏色而不改變最小化/關閉按鈕顏色

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; 
} 

回答

3

不幸的是,這是不可能的。但是,您可以將應用的內容擴展到標題欄,然後創建自己的後退按鈕。看看here