WebView 上的自动换行
Word Wrap on WebView
我一直在寻找和寻找,似乎无法找到解决方案。 Webview 有自动换行 属性 吗?特别是在通用 Windows 应用程序中。
这是我的网页视图:
<WebView x:Name="body"
Visibility="Visible"
RelativePanel.Below="mySymbol"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
DefaultBackgroundColor="LightGray"
Height="300"
Width="1800"
Margin="-5,80"/>
我希望有类似于 TextWrapping="Wrap"
的东西,就像我在 TextBlock
中使用的那样......
有没有人有任何建议或解决方法?
我找到了问题所在。我把我的 WebView
放在 RelativePanel
里面...看起来它可以防止 WebView
文本换行。
同时将宽度和高度设置为 auto
在 WebView 中显示的文本换行将取决于加载到其中的 HTML 以及 WebView 本身的属性(大小)和可视化树。
我一直在寻找和寻找,似乎无法找到解决方案。 Webview 有自动换行 属性 吗?特别是在通用 Windows 应用程序中。
这是我的网页视图:
<WebView x:Name="body"
Visibility="Visible"
RelativePanel.Below="mySymbol"
RelativePanel.AlignLeftWithPanel="True"
RelativePanel.AlignRightWithPanel="True"
DefaultBackgroundColor="LightGray"
Height="300"
Width="1800"
Margin="-5,80"/>
我希望有类似于 TextWrapping="Wrap"
的东西,就像我在 TextBlock
中使用的那样......
有没有人有任何建议或解决方法?
我找到了问题所在。我把我的 WebView
放在 RelativePanel
里面...看起来它可以防止 WebView
文本换行。
同时将宽度和高度设置为 auto
在 WebView 中显示的文本换行将取决于加载到其中的 HTML 以及 WebView 本身的属性(大小)和可视化树。