[英]Change System Tray Color Windows Phone
有沒有辦法將Windows Phone上的系統托盤顏色從黑色更改為白色? 我的應用程序有白色背景,所以我也希望系統托盤是白色的。
您可以在頁面XAML中執行此操作:
<phone:PhoneApplicationPage
...
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
shell:SystemTray.IsVisible="True"
shell:SystemTray.BackgroundColor="Blue">
...
在Mango / 7.1中,您可以設置SystemTray的BackgroundColor屬性。 如果您的目標是7.0,那么您唯一的選擇是使用SystemTray.IsVisible完全隱藏SystemTray。
如果你想從xaml改變它,你可以這樣做。
<phone:PhoneApplicationPage .........................
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
shell:SystemTray.BackgroundColor="{StaticResource AppThemeColor }"
shell:SystemTray.IsVisible="True">
其中“AppThemeColor”是我的應用程序的樣式資源的預定義顏色。
如果你想從C#代碼改變它。 然后你可以在OnNavigatedTo()事件中使用以下代碼。
SystemTray.BackgroundColor = Color.FromArgb(255, 250, 110, 40); //background color
SystemTray.ForegroundColor = Color.FromArgb(120, 245, 245, 245);//foreground if you need
SystemTray.Opacity = 0.9; // opacity of background color
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.