未显示平铺图像

Tile Image not shown

我尝试使用模板 w TileWide310x150SmallImageAndText02 设置我的主图块。我看了一下示例代码并从中取出了这个:

            ITileSquare310x310SmallImagesAndTextList04 tileContent =
            TileContentFactory.CreateTileSquare310x310SmallImagesAndTextList04();
        tileContent.Image1.Src = "ms-appx:///Assets/Logo.png";
        tileContent.TextHeading1.Text = "Cashflow";
        tileContent.TextWrap1.Text = "Income: 500";
        tileContent.TextWrap2.Text = "Spending: 400";
        tileContent.TextWrap3.Text = "Earnings: 200";

        // Create a notification for the Wide310x150 tile using one of the available templates for the size.
        ITileWide310x150SmallImageAndText02 wide310x150Content =
            TileContentFactory.CreateTileWide310x150SmallImageAndText02();
        wide310x150Content.Image.Src = "ms-appx:///Assets/Logo.png";
        wide310x150Content.TextHeading.Text = "Cashflow";
        wide310x150Content.TextBody1.Text = "Income: 500";
        wide310x150Content.TextBody2.Text = "Spending: 400";
        wide310x150Content.TextBody3.Text = "Earnings: 200";

        // Create a notification for the Square150x150 tile using one of the available templates for the size.
        ITileSquare150x150PeekImageAndText01 square150x150Content =
            TileContentFactory.CreateTileSquare150x150PeekImageAndText01();
        square150x150Content.Image.Src = "ms-appx:///Assets/Logo.png";
        square150x150Content.TextHeading.Text = "Cashflow";
        square150x150Content.TextBody1.Text = "Income: 500";
        square150x150Content.TextBody2.Text = "Spending: 300";
        square150x150Content.TextBody3.Text = "Earnings: 200";

        // Attach the Square150x150 template to the Wide310x150 template.
        wide310x150Content.Square150x150Content = square150x150Content;

        // Attach the Wide310x150 template to the Square310x310 template.
        tileContent.Wide310x150Content = wide310x150Content;

        // Send the notification to the application? tile.
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());

这将在 150x150 尺寸下正确显示图块,但不能在宽尺寸下正确显示。然后只显示文本而不显示图像。

截图如下:

感谢您的帮助! NPadrutt

SmallImageAndText 模板仅在 Windows 上显示图像,在 Phone 上不显示图像。

这里的差异请参考template catalog

Tipp:模板目录位于 aka.ms/tiletemplates