只注意到它的BackgroundColor
B值;
你的方法是絕對正確的:
ApplicationBar.BackgroundColor = Colors.Yellow;
對於RGB它應該是這樣的:
ApplicationBar.BackgroundColor = Color.FromArgb(0xFF, 246, 254, 64);
如果你有HTML的顏色,你可以做::
string htmlColor = "#f6fe40";
ApplicationBar.BackgroundColor = Color.FromArgb(255,
Convert.ToByte(htmlColor.Substring(1, 2), 16),
Convert.ToByte(htmlColor.Substring(3, 2), 16),
Convert.ToByte(htmlColor.Substring(5, 2), 16)
);
編輯
看,我在主題管理器的源文件中找到:
Colors system trays appropriately and also any set ApplicationBar
instances. Will not theme ApplicationBar instances that are
created after the page's Navigated event or that are created and
not set immediately.
所以請嘗試這樣的事情(例如)
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
ThemeManager.ToLightTheme();
ApplicationBar.BackgroundColor = Colors.Yellow;
}
你現在可以試試嗎 –