.netuwplive-tile

UWP Application live tile text size


There is an Clock tile app in windows store. I wonder how to make the tile font size like in this app.


Solution

  • In adaptive tiles, we should use hint-style in text element to set text's font size. Styles control the font size, color, and weight of text elements. However there are only a number of available styles that can be used in hint-style.
    enter image description here
    For more information, please see Text styles in Create adaptive tiles.

    So we can't assign an arbitrary font size in adaptive tiles. I'd suppose in the app you've mentioned, it is sending tiles with images. The image might be generated from a custom XAML layout by implementing a XamlRenderingBackgroundTask.

    XamlRenderingBackgroundTask provides the ability to render XAML trees as a bitmap from a background task, often to generate custom tiles. If adaptive can’t achieve what you want on a tile, this is an option. And while using custom XAML layout, we can then set the font size with TextBlock.FontSize property to whatever value we want.

    For an example, please see Updating a tile from a background task.