UWP:如何渲染多列WebView而不是垂直滚动条

时间:2017-03-24 06:33:12

标签: css xaml webview uwp

我没有滚动条而是想将它移动到下一列,是否可以使用WebView控件?

见下图:

enter image description here

内容包含" Red Box"我想把它移到第二栏。

XAML代码:

<Grid>
<Grid.RowDefinitions>
    <RowDefinition Height="Auto" />
    <RowDefinition Height="500" />
</Grid.RowDefinitions>

<Grid Grid.Row="0" />
<WebView Grid.Row="1" Width="410" local:WebViewProperties.HtmlString="{Binding Description}"></WebView>

1 个答案:

答案 0 :(得分:0)

  

如何渲染多列WebView而不是垂直滚动条

WebView无法将您的HTML内容呈现为多列。此问题也不应由WebView控件完成。您应该能够通过CSS样式将HTML内容设置为多列。例如,以下newspaper div显示为两列。

<!DOCTYPE html>
<html>
<head>
    <style>
        .newspaper {
            -webkit-column-count: 2; /* Chrome, Safari, Opera */
            -moz-column-count: 2; /* Firefox */
            column-count: 2; 
        }
    </style>
</head>
<body>
    <p><b>Note:</b> Internet Explorer 9, and earlier versions, does not support the column-count property.</p>
    <div class="newspaper">
        Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.
    </div>
</body>
</html>

更多详情请参阅CSS3 Multiple Columns。通过HTML元素或CSS样式将HTML布局更新为您想要的内容,然后渲染它们。