Bra*_*son 7 windows xaml windows-phone-8.1
我正在使用Xaml和C#为Windows Phone 8.1和Windows 8.1创建通用的Windows运行时应用程序.
我有内联超链接设置如此 -
<TextBlock Width="400" TextWrapping="Wrap">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)
这将显示带有下划线的文本,指示可点击的超链接.但是我想通过颜色指示超链接而不是下划线,因为我可以在TextBlock中有多个超链接.
我想从内联超链接中删除下划线 - 在WP 8.1和Windows 8.1 Store应用程序中不再存在TextDecorations属性.
注意*我使用的是Hyperlink元素而不是HyperlinkButton,因为我需要将链接与文本内联.
小智 1
我会写评论,但我的声誉不足以做到这一点。
我在空白的 win 8.1 和 win Phone 8.1 项目上尝试了相同的代码。但是,与您的项目不同,超链接默认以颜色显示,而不是带下划线。我的代码如下
<TextBlock Width="400" TextWrapping="Wrap">
<Span FontSize="20">
This is an example of how Hyperlink can be used in a paragraph of text. It might be helpful for you look to
<Hyperlink NavigateUri="http://www.bing.com" Foreground="#FF0007FF">bing</Hyperlink>
for more answers in the future.
</Span>
</TextBlock>
Run Code Online (Sandbox Code Playgroud)
你能尝试一下 Foreground 属性吗?也许它对你有帮助。
归档时间: |
|
查看次数: |
1574 次 |
最近记录: |