在设置弹出XAML中:
<SettingsFlyout
x:Class="D_Day.CustomWebview"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:D_Day"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="CustomWebview"
Padding="0"
d:DesignWidth="346"
>
<StackPanel Background="#ff121212" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<WebView x:Name="webView" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</StackPanel>
</SettingsFlyout>
和.VB:
Private Sub CustomWebview_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
webView.Navigate(New Uri("http://google.com"))
End Sub
当设置弹出窗口显示时,webview永远不会开始导航。 只显示空白视图(不知道它是网页还是空白网页)。
是否无法在SettingFlyout上实现WebView?
答案 0 :(得分:0)
使用特定的xaml,您必须在WebView上设置宽度和高度。您当前拥有的内容会使控件的宽度/高度为零。
以下webview xaml适用于我:
<WebView x:Name="webView" Width="320" Height="400"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />