다음을 통해 공유


The toast template catalog (Windows Runtime apps)

This topic lists the templates available for use in a toast notification, with pictorial examples of each together with their XML content.

Note  You can send any toast template to Windows Phone 8.1, but it will be rendered as a modified version of ToastText02, with no image, two text strings (both on the same line, the first string in bold), and the "Square 150x150" logo as provided in the app's manifest. An example is shown here:

Text-only templates

ToastText01

A single string wrapped across a maximum of three lines of text.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastText01">
            <text id="1">bodyText</text>
        </binding>  
    </visual>
</toast>

 

ToastText02

One string of bold text on the first line, one string of regular text wrapped across the second and third lines.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastText02">
            <text id="1">headlineText</text>
            <text id="2">bodyText</text>
        </binding>  
    </visual>
</toast>

 

ToastText03

One string of bold text wrapped across the first and second lines, one string of regular text on the third line.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastText03">
            <text id="1">headlineText</text>
            <text id="2">bodyText</text>
        </binding>  
    </visual>
</toast>

 

ToastText04

One string of bold text on the first line, one string of regular text on the second line, one string of regular text on the third line.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastText04">
            <text id="1">headlineText</text>
            <text id="2">bodyText1</text>
            <text id="3">bodyText2</text>
        </binding>  
    </visual>
</toast>

 

Image-and-text templates

Note  Any toast shown on Windows Phone 8.1 does not display the image as shown in these templates, instead replacing it with the app's logo.

In this set of templates, the image element is expressed using one of these protocols:

  • http:// or https://

    A web-based image.

  • ms-appx:///

    An image included in the app package.

  • ms-appdata:///local/

    An image saved to local storage.

  • file:///

    A local image. (Only supported for desktop apps.)

ToastImageAndText01

An image and a single string wrapped across a maximum of three lines of text.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastImageAndText01">
            <image id="1" src="image1" alt="image1"/>
            <text id="1">bodyText</text>
        </binding>  
    </visual>
</toast>

 

ToastImageAndText02

An image, one string of bold text on the first line, one string of regular text wrapped across the second and third lines.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastImageAndText02">
            <image id="1" src="image1" alt="image1"/>
            <text id="1">headlineText</text>
            <text id="2">bodyText</text>
        </binding>  
    </visual>
</toast>

 

ToastImageAndText03

An image, one string of bold text wrapped across the first two lines, one string of regular text on the third line.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastImageAndText03">
            <image id="1" src="image1" alt="image1"/>
            <text id="1">headlineText</text>
            <text id="2">bodyText</text>
        </binding>  
    </visual>
</toast>

 

ToastImageAndText04

An image, one string of bold text on the first line, one string of regular text on the second line, one string of regular text on the third line.

Example

Example XML
<toast>
    <visual>
        <binding template="ToastImageAndText04">
            <image id="1" src="image1" alt="image1"/>
            <text id="1">headlineText</text>
            <text id="2">bodyText1</text>
            <text id="3">bodyText2</text>
        </binding>  
    </visual>
</toast>

 

ToastTemplateType enumeration

Quickstart: Sending a toast notification

The toast audio options catalog

Toast XML schema

Toast notifications sample

Toast notification overview