【发布时间】:2015-08-18 13:01:24
【问题描述】:
在此处开发 Windows 10 UWP(通用 Windows 平台)应用... 我有一个很长的文本,我不想把它换成几行。我希望它足够长,以便最终用户可以水平滚动以在一行中查看整个文本。
<ScrollViewer HorizontalScrollMode="Enabled" Width="Auto">
<TextBlock Text="This is a long text that I don't want it to be wrapped in multiple lines. I want it to be horizontally long so the user can horizontally scroll to see the text"
Margin="50, 50, 0, 0"></TextBlock>
</ScrollViewer>
但是当我运行应用程序时,文本在右边缘被截断,我无法水平滚动以查看其余文本。 有没有办法使用带有一些附加属性的 ScrollView 来实现? 这是应用程序外观的屏幕截图。
【问题讨论】:
-
你试过设置绝对宽度吗?
-
是的,使用 Width="200"(和任何其他值)它不会滚动...
-
是在 Scrollviewer 上还是在 Textblock 上?
-
无论我把它放在哪里,它都不起作用。
标签: scrollviewer uwp