I just upgraded my app to Windows 8.1, but now pages that I am loading into the WebView are no longer interactive. I can't press any buttons or fill out any HTML form fields. My WebView looks like this
<WebView x:Name="browser" ScrollViewer.ZoomMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled"></WebView>
I just created a new Windows Store app for Windows 8.1 based on the Blank App (XAML) template only putting the following line inside the Grid of MainPage.xaml:
<WebView x:Name="browser" ScrollViewer.ZoomMode="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled" Source="http://www.quackit.com/html/codes/html_form_code.cfm" />
The HTML form controls behave as expected. Does this work for you? Do you have anything else on your page that could prevent interaction with HTML controls?
Maybe you have other (transparent) controls over the WebView. There's a change in z-ordering in Windows 8.1: in Windows 8 WebView was always rendered on top of other controls, now it can be rendered under other controls.
I just put the WebView with an Rectangle in a Grid and it seems that all the inputs are captured by the Rectangle:
<Grid>
<WebView Name="ContentWebView" ScrollViewer.ZoomMode="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollMode="Disabled"
DefaultBackgroundColor="Transparent" Height="Auto" MinHeight="600" />
<Rectangle Fill="Transparent"></Rectangle>
</Grid>
U should navigate webview or set source as explained above. Blank webview does not show anything
browser.navigate("http://example.com//");
Related
I have two images, one for windows phone and second for windows project. and I want these images on every page of their respective platform.
What currently I am doing is setting background from app.cs in if windows phone and if windows app code snippets.
I want any xaml method if any for this.
Set the background of each page to a common resource and then set that resource to your image. By default the page's background will be set to
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
You can set the ApplicationPageBackgroundThemeBrush to an ImageBrush in your app.xaml's Resources, but since you want different images for Windows and for Windows Phone add another level of indirection. Create a ResourceDictionary of the same name in both projects and then merge that dictionary into Application.Resources.
In app.xaml:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="PlatformDictionary.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Then set the actual brush in PlatformDictionary.xaml files in the Windows and Windows Phone projects. Generally you'll fall back to defaults in HighContrast modes, but if you have important information in the image you can provide a high contrast version of the image as PhonePageBackground.contrast-high.png using the contrast resource qualifiers:
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Name="Default">
<ImageBrush x:Key="ApplicationPageBackgroundThemeBrush" ImageSource="Assets/PhonePageBackground.png"/>
</ResourceDictionary>
<ResourceDictionary x:Name="HighContrast">
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="{ThemeResource PhoneBackgroundColor}"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
The Windows version will be the same except for your Windows page background image in the default theme and SystemColorWindowColor in the HighContrast theme.
I'm learning windows phone app development. I took yahoo mail site as sample and using it in the web browser control. I want to understand what settings I need to unable in web browser control to look the web page in web browser control as same as how that shows in Internet explorer on Windows phone. Here the screen shots what I see now
In the windows phone browser it looks like below -
Thing I'm missing here in my app is, I cannot see the 'Search mail' text in the search text box in my app.
The most IMPORTANT thing is that when I click the mail item in the app nothing happens. But in Internet explorer it actually opens the mail body.
Please guide me.
That probably caused by some functionality of the web page implemented using javascript. Therefore, try to set IsScriptEnabled property to true :
<WebBrowser IsScriptEnabled="True" .../>
That will enable javascript in the webbrowser control which is disabled by default.
I am building windows phone 8 Html 5 application, since my computer does not have capability to show emulator I am testing on real device.
My code is like below, when I launch my application, I do not see anything about banner, however I cannot tap on the place where ad is coming (For example I cannot click top header of browser because I know banner is there but totally transparent - not visible)
Is there any idea why it is happening?
<Grid x:Name="LayoutRoot" Background="Transparent">
<phone:WebBrowser x:Name="Browser"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Loaded="Browser_Loaded"
NavigationFailed="Browser_NavigationFailed" />
<UI:AdControl ApplicationId="test_client"
AdUnitId="Image480_80" Margin="0,0,10,600" />
</Grid>
It could be that it's working but there wasn't an ad available when you ran it. Add an event handler to the ErrorOccurred event and see if it gets hit. If ErrorOccurred get's hit, you should be able to look at what the error was. Most likely it will just be that there isn't an ad to show.
It's happened to me a few times, but it was just the fact that there's more ad's being requested to be shown than there are ad's to fill the spaces.
for a security critial app I need to prevent the phone making screenshots of the embedded browser control.
On Windows Phone, if you hold the back button pressed, the opened applications are shown with small preview images.
Is there any way to replace that image being used there by an own image. Or is it possible to exclude controls using a xaml syntax from beeing captured?
Thanks Holger
Windows Phone 8 GDR 3 introduced a hidden property on the page object that you can use to prevent screenshots from being taken of that page. Here is more detail
Windows Phone 8 :
I have an HTML design to bind in webbrowser control.
In that HTML I need to set the image() dynamically from my windows 8 phone application itself (Eg:MyApp/Images/Done.png).
How to set this Image in my HTML dynamically?
Could any one help me on that?
In terms of Zen, WP8 tried to align Uris as close as possible to Win8 Uris. So whenever you ask yourself "How do WP8 Uris work?" a good starting point would be Win8 and WP7 behaved. For example, you'll see lots of "ms-appx:///" and "ms-appdata:///" all around WP8.
Specfically, In order to access an app's Image resources from a WebBrowser just specify the local file path.For example, start a new WP8 project and in MainPage.xaml add:
<phone:WebBrowser Source="myPage.html" />
And create myPage.html and add:
<html>
<body>
<img src="Assets/AlignmentGrid.png"/>
</body>
</html>
This would render the correct image as part of the WebBrowser. See attached .