简体   繁体   中英

UWP WebView in RelativePanel does not display web page

I have 3 WebView each in a PivotItem inside a RelativePanel like that:

<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>

My problem is that the WebView content is not shown and I do not understand why. Before using a RelativePanel , I used a Grid and it worked well.

Can you explain why it does not work?

Thank you for your help.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM