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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Regular Contributor
Posts: 67
Registered: ‎06-30-2010
My Device: Storm 9550
My Carrier: Airtel

Setting background color of a brwoser field

Hi,

 

I am passing some html content to a browser field. The content is getting displayed with white background and black text. But i want to set the background color to black and the text color to white. Can anyone guide me how to achieve it...???

Developer
Posts: 39
Registered: ‎02-06-2010
My Device: 9000
My Carrier: devloper

Re: Setting background color of a brwoser field

[ Edited ]

hey

 

try this for set background of browser field:

 

bf.displayContent("<html><body bgcolor=\"red\">asdf</body></html>", "");

 

(if problem is solved than khudos plz)

 

 

Developer
Posts: 950
Registered: ‎06-22-2010
My Device: 9550

Re: Setting background color of a brwoser field

Rahul If U r Using jde 5.0 then U can USe This for change the Background Color Of

BrowserField

 

First create the instance of BrowserField. then Use the Method.

 

setBackground(int color); //Simple Method.

if confuse then Look into this Link

 

http://www.blackberry.com/developers/docs/5.0.0api/net/rim/device/api/browser/field2/BrowserField.ht...

 

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

Feel Free ToPress Kudoed If Got Solution.

 

Regular Contributor
Posts: 67
Registered: ‎06-30-2010
My Device: Storm 9550
My Carrier: Airtel

Re: Setting background color of a brwoser field

 

I have set the background color to black but how can i set the text color to white...???

Developer
Posts: 53
Registered: ‎10-29-2010
My Device: Not Specified

Re: Setting background color of a brwoser field

Handle the navigation and add that style into the page code before displaying it Smiley Wink

New Developer
Posts: 3
Registered: ‎11-09-2010
My Device: 9700 Bold 2

Re: Setting background color of a brwoser field

[ Edited ]

Hi, a workaround if setBackground doesn't work can be append css styles to the displayed content:

 

String BROWSER_STYLES="<style>body{background-color: #eeeeee; color: red;}</style>"
// fetch the content to display...example
String htmlContent = Utils.getHtmlContent();
// append the styles 
htmlContent = BROWSER_STYLES + htmlContent;
// display the content
browserField.displayContent(htmlContent,"");

 

Hope this helps...

 

Cheers!