0

我正在尝试在 Windows Phone 8 Nokia Lumia 上的 ViewBox 元素中显示浏览器。

WebBrowser 单独显示时显示,但是当我将它放在 ViewBox 元素中时,它不显示。

这是我的示例代码:

<phone:PhoneApplicationPage
    x:Class="PhoneApp2.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->

    <Viewbox Stretch="Fill" >

        <phone:WebBrowser Source="http://google.com" />
    </Viewbox>

</phone:PhoneApplicationPage>
4

1 回答 1

0

嘿,问题是视图框控件的默认高度和宽度..只需设置视图框控件的高度和宽度..这样就可以了..

<Viewbox Grid.Row="0"  VerticalAlignment="Top" HorizontalAlignment="Left">
        <phone:WebBrowser Grid.Row="0" Height="800" Source="http://www.google.com" Width="500" />
    </Viewbox>

任何查询..下面的评论..

于 2013-07-18T05:27:37.353 回答