在 Windows Phone 7 中,是否可以在文本块内放置渐变颜色?

发布于 2024-12-20 22:08:06 字数 114 浏览 1 评论 0原文

在 Windows Phone 7 中,是否可以在文本块内放置渐变颜色?

例如,在 XAML 部分中,有没有一种方法可以指示样式并应用线性渐变?

另外,如果是的话,可以动态应用渐变吗

In windows phone 7 is it possible to put a gradient colour inside a textblock?

For example in the XAML part is there a way to indicate style and apply a linear gradient?

Also if so can the gradient be applied dynamically

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾`听者〃 2024-12-27 22:08:06

尝试这个前景

<TextBlock.Foreground>
    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        GradientStop Color="Black" Offset="0"/>
        <GradientStop Color="#FFFF6565" Offset="1"/>
    </LinearGradientBrush>
</TextBlock.Foreground>

如果你需要填充背景 - 将文本块放入容器内

Try this for foreground

<TextBlock.Foreground>
    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        GradientStop Color="Black" Offset="0"/>
        <GradientStop Color="#FFFF6565" Offset="1"/>
    </LinearGradientBrush>
</TextBlock.Foreground>

If you need fill background - put textblock inside container

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文