about the webview 's transparent?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

about the webview 's transparent?

Postby lqsohu » Mon Jun 30, 2008 3:26 am

I am using the webview show a html,
when i loadurl( html), the html is showing now ,but the background is white ?
I want to the background is transparent ?
I try to do it from html(it is no success)
I also try use the function API of the webkit or webview (I still no success)
Can u help me?
thks
I am looking forward to u !
lqsohu
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 24, 2008 4:45 am

Top

Postby lqsohu » Tue Jul 01, 2008 3:13 am

I read the source of webkit__m5 (down from codegoogle ),
but I donot see the webview class constructor .
I donot know how shoule I do !
lqsohu
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 24, 2008 4:45 am

Postby michael_g_hu » Wed Jul 02, 2008 9:05 am

in the source file:
/**
* Set the background color. It's white by default. Pass
* zero to make the view transparent.
* @param color the ARGB color described by Color.java
*/
public void setBackgroundColor(int color)

have you try this method?
michael_g_hu
Developer
Developer
 
Posts: 35
Joined: Fri Mar 21, 2008 9:46 am

Postby lqsohu » Mon Jul 07, 2008 9:31 am

sure !
I try for this way!
I set background is yellow , but the webview is not yellow , it still write .

I donnot have any better way to solve it ?

pls give a favor! thks!
lqsohu
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 24, 2008 4:45 am

Postby michael_g_hu » Mon Jul 07, 2008 10:55 am

I can change the background color in the the native environment , I think you can wait for the next release.
michael_g_hu
Developer
Developer
 
Posts: 35
Joined: Fri Mar 21, 2008 9:46 am

Postby lqsohu » Tue Jul 08, 2008 10:45 am

the view can be changed the background , but the webview is not change
however ,the next release will can do that ?
R u sure?
lqsohu
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 24, 2008 4:45 am

Top

Postby michael_g_hu » Wed Jul 09, 2008 3:21 am

need a screen capture? but you can only change the background color before loading page.
when page loaded. the background will change according to the source code of page
michael_g_hu
Developer
Developer
 
Posts: 35
Joined: Fri Mar 21, 2008 9:46 am

Postby lqsohu » Tue Jul 15, 2008 3:25 am

psl tell me detailly. thks ! I am not konw yr idea!
lqsohu
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 24, 2008 4:45 am

the webview can transparent?

Postby lqsohu » Thu Aug 21, 2008 8:32 am

the new SDK version is can be setbackground about webview
but it still not transparent. (at least i see )
can u tell me how to transparent about load a webview ?
thks
lqsohu
Freshman
Freshman
 
Posts: 9
Joined: Tue Jun 24, 2008 4:45 am

How you do it...

Postby spokebloke » Mon Jan 26, 2009 8:41 am

Come on guys...this is so simple, I fooled around for about 5 minutes earlier today, and figured it out.

To achieve transparency both the view's background drawable, which is inherited, and the WebView's backgroundColor variable must be assigned values of 0. The first may be accomplished through either a call to setBackgroundDrawable(), or the android:background tag in the xml. The second is set by calling setBackgroundColor().
spokebloke
Freshman
Freshman
 
Posts: 3
Joined: Wed Nov 19, 2008 10:37 pm

Re: How you do it...

Postby MrSnowflake » Mon Jan 26, 2009 12:27 pm

spokebloke wrote:Come on guys...this is so simple, I fooled around for about 5 minutes earlier today, and figured it out.

To achieve transparency both the view's background drawable, which is inherited, and the WebView's backgroundColor variable must be assigned values of 0. The first may be accomplished through either a call to setBackgroundDrawable(), or the android:background tag in the xml. The second is set by calling setBackgroundColor().
Uhm, this thread is over 5 months old, and they are talking about the M5 sdk, so your comment probably isn't very relevant.

This is also the reason why you shouldn't revive old threads.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 2 guests