在辅助磁贴上换行文本

时间:2016-12-19 12:08:39

标签: c# uwp windows-10-mobile secondary-live-tile

我想在辅助磁贴上显示大文本(大约20个字符),但在移动屏幕和桌面上开始菜单文本看起来不同(显示移动文本而不剪切)。有没有办法在手机屏幕上用瓷砖包装文字?

这就是桌面上文字的外观:
Text on Desktop tile

这是文字在移动设备上的显示方式:
Text on Mobile device tile

代码示例:

var secondaryTile = new SecondaryTile(Id.ToString(), 
"Large large large large large text","secondary_tile_id=" + Id,
uri150X150Logo, TileSize.Square150x150)
{
    VisualElements =
    {
        Square310x310Logo = uri310X310Logo,
        Square44x44Logo = uri44X44Logo,
        Square71x71Logo = uri71X71Logo,
        Wide310x150Logo = uri310X150Logo,
        Square150x150Logo = uri150X150Logo,
        ForegroundText = ForegroundText.Dark,
        ShowNameOnSquare150x150Logo = true,
        ShowNameOnSquare310x310Logo = true,
        ShowNameOnWide310x150Logo = true,
        BackgroundColor = Colors.White   
    },               
    RoamingEnabled = false,                
};        
await secondaryTile.RequestCreateAsync();

1 个答案:

答案 0 :(得分:0)

你可以在Adaptive Tile Templates – Schema and Documentation包装文本,有一个描述自适应瓷砖的所有功能的链接,但是不允许仅链接答案,所以这里有一些文字细节:

<text
  lang? = string
  hint-style? = textStyle
  hint-wrap? = boolean
  hint-maxLines? = integer
  hint-minLines? = integer
  hint-align? = "left" | "center" | "right" >
  <!-- text goes here -->
</text>

有一个提示包装属性,所以可以确保文本包装,那里有一些例子,但也推荐商店的Notifications Visualiser来帮助创建它们。