2017-08-31 86 views
1

我們最近從Windows10.10.10240的Windows框架升級到10.0.15063。我們遇到了button設計問題,其中background color顯示爲灰色。在升級之前,此顏色未出現。我們需要刪除文字背後的這種灰色。UWP中的背景顏色App

After windows framework upgrade

在圖像的懸停也同樣前景色顯示:

enter image description here

Xamarin.Forms.Button沒有前景色相等的屬性。我嘗試了設置Xamarin.Forms.Platform.UWP.FormsButton.Foreground的自定義渲染器,但對按鈕控制沒有影響。

是否有任何風格二傳手我可以嘗試解決這個問題?請任何幫助。

編輯

這是通過應用背景顏色,前面我在按鈕設置前景色解決,

this.Control.BackgroundColor = new SolidColorBrush() { Opacity = 1, Color= Windows.UI.Colors.Transparent }; 
+2

如果你指的是灰色的矩形,那不是前臺,這就是按鈕的背景屬性,前景屬性通常歸因於文本的顏色,並有獨立的onHover選項可供選擇顏色並修改。 – Digitalsa1nt

+0

我無法在我身邊重現您的問題。你有沒有在你的uwp客戶端項目中定製按鈕'ContentTemplate'或按鈕'Style'? –

+0

感謝您的幫助。@ Digitalsa1nt它的BackgroundColor屬性,並手動將其設置爲透明。 @ NicoZhu-MSFT我在https://msdn.microsoft.com/en-in/library/windows/apps/mt299109.aspx上的按鈕上使用自定義樣式屬性,但在最近的版本中出現了這個問題。現在手動設置'this.Control.BackgroundColor = new SolidColorBrush(){Opacity = 1,Color = Windows.UI.Colors.Transparent};'運行良好。 – Vishnu

回答

0

這是通過應用背景顏色解決。

this.Control.BackgroundColor = new SolidColorBrush(){Opacity = 1,Color = Windows.UI.Colors.Transparent };