xaml – 为什么TextBlock从文本中修剪结尾的空格?
发布时间:2020-12-13 20:10:15 所属栏目:Windows 来源:网络整理
导读:这是我的TextBlocks StackPanel Orientation="Horizontal" Margin="0,3,0" TextBlock Text="6 or more characters,at least one letter and a number," FontFamily="Segoe UI" Foreground="#000000" FontSize="13"/ TextBlock Text="no symbols" FontFamily=
这是我的TextBlocks
<StackPanel Orientation="Horizontal" Margin="0,3,0"> <TextBlock Text="6 or more characters,at least one letter and a number," FontFamily="Segoe UI" Foreground="#000000" FontSize="13"/> <TextBlock Text="no symbols" FontFamily="Segoe UI" Foreground="#000000" FontSize="13"/> </StackPanel> 这里是输出(屏幕截图) 为什么TextBlock修剪结尾的空格?但是当我提供领先的空间时它工作正常.
它看起来像xml:space =“保留”应该做的伎俩(见
Preserving Whitespace in XAML),但这似乎没有在Windows Store应用程序(它在WPF中).
如果您使用不间断空格字符它工作正常 <TextBlock Text="6 or more characters,       " .... 我想你可以尝试在Text属性上构建一个转换器来检查尾随空格并替换为非空格 – 假定发生的截断不会太早发生. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐
- windows – 使用powershell更改注册表二进制数据
- AD PowerShell for Add Account & OU &
- windows – nt!没有Args的KeWaitForSingleObjec
- windows-server-2003 – IIS6网站/应用程序池可以
- Powershell命令可以将断开连接的用户从服务器上移
- active-directory – ADFS 3.0需要Powershell命令
- windows-vista – 如何诊断关机时挂起的Windows
- microsoft-cognitive – Microsoft Translator A
- windows – 什么是故障桶,我应该关心吗?
- WebRTC不适用于Windows
热点阅读