If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
reycri
Posts: 20
Registered: ‎09-14-2009
My Device: Not Specified

How to make browser field background transparent

I wrote a custom field class that displays the field returned by BrowserContent.getDisplayableContent().

This works fine except that I cannot find a way to make this field's background transparent so that the owning Manager's background image would be visible.

I added style="background-color:transparent;" to the html's <body> but it still draws a white background.

How can I do this?

 

Thanks in advance... 

Please use plain text.
New Developer
reycri
Posts: 20
Registered: ‎09-14-2009
My Device: Not Specified

Re: How to make browser field background transparent

I decided to install JDE 4.6 because the net.rim.device.api.ui.decor.Background class might help me.

 

I tried this:

 

bgTransparent = BackgroundFactory.createSolidTransparentBackground(0xffffff, 0);

contentField = browserContent.getDisplayableContent();

contentField.setBackground(bgTransparent);


but the browser field still has a non-transparent white background.

 

Am doing something wrong here? Or is this just impossible to achieve?

 

 

 

Please use plain text.
Developer
ydaraishy
Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: How to make browser field background transparent

This would be impossible to do. How do you determine transparency? With a white background? What about if the web page has a background image? What if the website has a different background colour?

 

Why do you want to do this anyway?

Please use plain text.
New Developer
reycri
Posts: 20
Registered: ‎09-14-2009
My Device: Not Specified

Re: How to make browser field background transparent

Thanks for your reply...

 

I need to do it this way for all the Field objects I use because, the manager (and/or screen) in which they are contained usually have a gradient or a very light background image (like a watermark) that have to show through.

So for the parts where I use a browser field, we don't want to have opaque rectangular areas blocking the background.

 

This is not a problem for other Fields because I can control the paint() and paintBackground() methods of those classes. But the browser field is an black box where I cannot override methods at run time.

Please use plain text.
Developer
ydaraishy
Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: How to make browser field background transparent

Why do you want to make the browser field harder to read that way? Like I said, it's not going to be possible.

 

One way you could interfere with the browser field would be to try and intercept the underlying connection and mangle the HTML, but that is rather tricky to do.

Please use plain text.
New Contributor
bobjthomasjr
Posts: 3
Registered: ‎06-10-2010
My Device: BB 8830
My Carrier: Verizon

Re: How to make browser field background transparent

What about if the web page has a background image?

What if the website has a different background colour?

Why do you want to do this anyway?

Why do you want to make the browser field harder to read that way?

-----------------------------------------

Why the obstinacy? This is a perfectly reasonable objective. e.g.:

 

With my application, I am displaying text and images that are defined by downloaded htmls. This way, the text and images of my application are configurable and dynamic at runtime. The htmls won't have a background image or background color because I defined them, and ideally, I would like the background of the field manager that I put the browsercontent.getDisplayableField() into, to show through.

 

reycri - did you find way to do this? Or, anyone else have any other constructive ideas? I will post back my solution if I find one. 

 

Cheers.

 

 

 

 

 

 

Please use plain text.
Developer
amahfouz
Posts: 29
Registered: ‎06-23-2009
My Device: Not Specified

Re: How to make browser field background transparent

Any resolution to this?

 

I need this feature. By the way, it is a very basic feature and I don't understand why someone would argue against it unless they have no idea about basic UI design concepts.

Please use plain text.