基于HTML 5 XAML的应用程序 [英] HTML 5 XAML based app
问题描述
您好我是Windows手机开发的新手
Hello I'm new to windows phone development
我正在尝试创建一个简单的单页,在此页面中嵌入了一个显示本地html文件的Web浏览器。
I am trying to create a simple single page, with a web browser embeded within this page showing a local html file.
接线这很简单,但我试图解决的问题是,我无法让页面加载全屏。左手边缘总是有一个恼人的间隙。我也想防止弹跳。我只想加载一个
html页面全屏没有多余的装饰。
Wiring this up was simple, but what I am tearing my hair out trying to solve, is that I cant get the page to load full screen. There is always an annoying gap on the left hand edge. I'd also like to prevent the bouncing around. I just want to load one html page full screen no frills.
这是我当前的XAML标记。任何人都可以给我任何指示
Heres my current XAML markup. Can anyone give me any pointers
<phone:PhoneApplicationPage
x:Class="HTML5App1.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="false">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot"
Background="Transparent"
HorizontalAlignment="stretch"
Grid.Row="1" Margin="0,0,0,0"
>
<!--<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>-->
<phone:WebBrowser x:Name="Browser"
HorizontalAlignment="stretch"
VerticalAlignment="Stretch"
Loaded="Browser_Loaded"
NavigationFailed="Browser_NavigationFailed"
Source="\Html\index.html"
IsScriptEnabled="True"
ScriptNotify="Browser_ScriptNotify"
/>
</Grid>
</phone:PhoneApplicationPage>
推荐答案
我刚试过WP 8.1上的Webview控件。 它被全屏占用,甚至没有弹跳。
I just tried with Webview control on WP 8.1. It is occupied full screen and it is not even bouncing.
<Page
x:Class="WebBrowserSample.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WebBrowserSample"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid x:Name="LayoutRoot"
Background="Transparent"
HorizontalAlignment="stretch"
Grid.Row="1" Margin="0,0,0,0">
<WebView x:Name="WebView" HorizontalAlignment="stretch"
VerticalAlignment="Stretch"
Source="http://pathfindersoftware.com/medical-software-development-4/"
/>
</Grid>
</Page>
屏幕截图 -
这篇关于基于HTML 5 XAML的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!