您好我正在使用以下代码,实时瓷砖工作正常,但我发现小徽标总是在那里左边的瓷砖,我怎么能摆脱它?见this
XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideImageAndText01);
XmlDocument squareTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquarePeekImageAndText01);
XmlNodeList textElements = tileXml.GetElementsByTagName("text");
textElements[0].AppendChild(tileXml.CreateTextNode(_serviceOrderItems.Count.ToString()));
XmlNodeList imageElements = tileXml.GetElementsByTagName("image");
XmlElement imageElement = (XmlElement)imageElements[0];
imageElement.SetAttribute("src", "ms-appx:///Assets/Image310X150.jpg");
imageElement.SetAttribute("alt", "Aker Solutions");
XmlNodeList squareImageElements = squareTileXml.GetElementsByTagName("image");
XmlElement squareImageElement = (XmlElement)squareImageElements.Item(0);
squareImageElement.SetAttribute("src", "ms-appx:///Assets/Image150X150.jpg");
squareImageElement.SetAttribute("alt", "Aker Solutions");
IXmlNode subnode = tileXml.ImportNode(squareTileXml.GetElementsByTagName("binding")[0], true);
tileXml.GetElementsByTagName("visual")[0].AppendChild(subnode);
TileNotification tile = new TileNotification(tileXml);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tile);
答案 0 :(得分:3)
设置品牌=“无”
<?xml version="1.0" encoding="UTF-8"?>
<tile>
<visual lang="en-US">
<binding template="TileSquareImage" branding="none">
<image id="1" src="http://abc..../xx.png"/>
</binding>
<binding template="TileWideImageAndText01" branding="none">
<image id="1" src="http://abc.../yy.png"/>
<text id="1">Test message</text>
</binding>
</visual>
</tile>
答案 1 :(得分:1)
修改强>
注意到您可以在可视节点或绑定节点上设置branding attribute的注释。
tileXml.getElementsByTagName('visual')[0].setAttribute('branding', 'none');
磁贴上有一个small logo property来控制它。但文档说明:
如果未提供此图像,则使用此辅助磁贴的父应用的小徽标。
由于您的应用还需要一个小徽标,因此无法将其关闭。解决方法是将小徽标设置为完全透明的30 x 30像素png。
var tile = new Windows.UI.StartScreen.SecondaryTile(newTileID, newTileShortName, newTileDisplayName, TileActivationArguments, newTileOptions, uriLogo);
tile.smallLogo = new Windows.Foundation.Uri("ms-appx:///images/smallLogoBlank.png");