【问题标题】:Wrap text on secondary tile在辅助磁贴上环绕文本
【发布时间】:2016-12-19 12:08:39
【问题描述】:

我想在辅助磁贴上显示大文本(大约 20 个字符),但在移动屏幕和桌面上“开始”菜单文本看起来不同(移动文本显示没有剪辑)。有没有什么办法可以让文字在手机屏幕的平铺中换行?

这是文本在桌面上的外观:

这是文本在移动设备上的外观:

代码示例:

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();

【问题讨论】:

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


    【解决方案1】:

    您可以换行,Adaptive Tile Templates – Schema and Documentation 处有一个描述 Adaptive Tiles 的所有功能的链接,但是不允许仅链接答案,因此这里有一些文本的详细信息:

    <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 来帮助创建它们。

    【讨论】:

    • 看起来这是一个错误。即使使用Notifications Visualiser 选项将测试磁贴固定到“开始”菜单磁贴,也无需包装或剪裁。但在桌面磁贴上看起来很棒。
    • 这很奇怪。我用MS official code sample 来测试这个案例。它在模拟器 14393/10586 中运行良好。
    • 奇怪,在使用这个的时候可能会出现某种问题,知道有用,因为在不久的将来也会用瓷砖做一些事情!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多