Colors WP8更改应用程序磁贴背景颜色

Colors WP8更改应用程序磁贴背景颜色,colors,background,windows-phone-8,tiles,Colors,Background,Windows Phone 8,Tiles,我一直在努力找出如何更改与我的应用程序关联的WP8磁贴的背景色。我已尝试使用以下格式在TemplateIconic标记下的WMAppManifest.xml中设置BackgroundColor属性 AARGGBB RRGGBB 这两种颜色似乎都不起作用,瓷砖始终是手机上设置的当前强调色。有人能告诉我正确的方向吗?提前感谢。根据Microsoft的说法,该值必须为#AARRGGBB。但我不能让它有任何价值。它似乎只是忽视了它 “如果BackgroundColor元素的颜色值不是以#FF开头, 例如

我一直在努力找出如何更改与我的应用程序关联的WP8磁贴的背景色。我已尝试使用以下格式在TemplateIconic标记下的WMAppManifest.xml中设置BackgroundColor属性

AARGGBB RRGGBB
这两种颜色似乎都不起作用,瓷砖始终是手机上设置的当前强调色。有人能告诉我正确的方向吗?提前感谢。

根据Microsoft的说法,该值必须为#AARRGGBB。但我不能让它有任何价值。它似乎只是忽视了它

“如果BackgroundColor元素的颜色值不是以#FF开头, 例如#FF524742,您的自定义背景色将不会显示和显示 将显示默认的主题颜色。”


您可以使用类似的方法设置应用程序磁贴的所有属性,包括BackgroundColor属性

//REFERENCE: http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207009(v=vs.105).aspx
// Set all the properties of the Application Tile.
private void SetApplicationTile()
{
    // Application Tile is always the first Tile, even if it is not pinned to Start.
    ShellTile TileToFind = ShellTile.ActiveTiles.First();

    // Application should always be found
    if (TileToFind != null)
    {
        IconicTileData TileData = new IconicTileData()
        {
            Title = "My App title",
            WideContent1 = "New Wide Content 1",
            WideContent2 = "New Wide Content 2",
            WideContent3 = "New Wide Content 3",
            //Count = 2,
            //BackgroundColor = Colors.Blue, 
            //BackgroundColor = new Color { A = 255, R = 200, G = 148, B = 255 },
            //BackgroundColor = Color.FromArgb(255, 200, 148, 55),
            //BackgroundColor = (Color)Application.Current.Resources["PhoneAccentColor"],
            BackgroundColor = HexToColor("#FF7A3B3F"),
            IconImage = new Uri("Assets/Tiles/IconicTileMediumLarge.png", UriKind.Relative),
            SmallIconImage = new Uri("Assets/Tiles/IconicTileSmall.png", UriKind.Relative),
        };

        // Update the Application Tile
        TileToFind.Update(TileData);
    }
}

public static Color HexToColor(string hex)
{
    return Color.FromArgb(
        Convert.ToByte(hex.Substring(1, 2), 16),
        Convert.ToByte(hex.Substring(3, 2), 16),
        Convert.ToByte(hex.Substring(5, 2), 16),
        Convert.ToByte(hex.Substring(7, 2), 16)
        );
}

如果未将BackgroundColor属性的A参数设置为255,则不会显示自定义背景色,而是显示默认的主题色


来自的评论表明您必须使用格式
#RRGGBB
。我正在使用#RRGGBB,很抱歉,我的帖子中忘记了包含#。我误解了目的。似乎设置背景色将为固定到“开始”菜单的平铺设置背景色,但不在应用程序列表中。我已经证实了#AARGGBB是有效的。