【问题标题】:UWP WebView in RelativePanel does not display web pageRelativePanel 中的 UWP WebView 不显示网页
【发布时间】:2018-02-24 12:10:15
【问题描述】:

我有 3 个 WebView 每个 PivotItemRelativePanel 中,就像这样:

<RelativePanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Pivot Name="pivot"
           RelativePanel.AlignTopWithPanel="True"
           RelativePanel.AlignLeftWithPanel="True"
           RelativePanel.AlignRightWithPanel="True">
        <PivotItem Header="Slack LiveTile">
            <WebView Name="webView_001" />
        </PivotItem>
        <PivotItem Header="Slack RDV Tech">
            <WebView Name="webView_002" />
        </PivotItem>
        <PivotItem Header="WhatsApp">
            <WebView Name="webView_003" />
        </PivotItem>
    </Pivot>

    <CommandBar
        RelativePanel.AlignBottomWithPanel="True"
        RelativePanel.AlignLeftWithPanel="True"
        RelativePanel.AlignRightWithPanel="True" />

</RelativePanel>

我的问题是未显示 WebView 内容,我不明白为什么。在使用RelativePanel 之前,我使用了Grid,效果很好。

你能解释为什么它不起作用吗?

感谢您的帮助。

【问题讨论】:

    标签: c# xaml webview uwp relativepanel


    【解决方案1】:

    这是因为您还需要 Pivot 上的 RelativePanel.AlignBottomWithPanel="True" 来拉伸以填充整个空间,否则它只会占用足够 PivotHeaders 的空间。

    【讨论】:

    • 谢谢!我添加了RelativePanel.Above="commandBar" 以延伸到CommandBar 的顶部。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-08
    相关资源
    最近更新 更多