Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am working on Windows phone 8 app.

This is my code:

i am binding the data in the XAML:

<phone:WebBrowser  IsScriptEnabled="True"
                                       ScriptNotify="BrowserControlScriptNotify"
                                       ListBoxWebView:WebBrowserUtility.Html="{Binding WebView}"/>

here WebView is the data binded to webbrowser control.

I have the content like this:

<html><head>{0}</head><body bgcolor=BGCOLOR style="margin:0px;padding:0px;" "

here bgcolor=BGCOLOR i want the bgcolor to be transparent.

i have tried <body style="background: transparent; margin: 0; padding: 0;"> but its not working.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
782 views
Welcome To Ask or Share your Answers For Others

1 Answer

As per the answer I gave here (and you've seen), it is not possible to make the background of a webbrowser control transparent.

As an alternative, you could use an image of the page without the webbrowser control displayed as the background of the HTML page you're displaying.

A couple of provisos though:
Obviously this wouldn't work with a page that has content that moves or changes.
If the XAML page content isn't fixed then you'll need to create a bitmap of the screen to use as the background.
You may have to be careful with the relative path to the image (from HTML).
This is untested, by me, and just an idea.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...