0

When I use a HTMLComponent in LWUIT 1.5, it seems that the background is defaulted to white. How do I make it transparent, or at least a background color that fills the entire screen?

I have tried the following:

.getStyle.setBgTransparency(0);
.getUnselectedStyle().setBgTansparency(0);
.getSelectedStyle().setBgTransparency(0);

.getStyle.setBgColor(0xff0000);
.getUnselectedStyle().setBgColor(0xff0000);
.getSelectedStyle().setBgColor(0xff0000);

All of the above are ignored.

I have also tried putting a color in the body:

.setBodyText("<div style='background: #ff0000'>Some text</div>");
.setBodyText("<body style='background: #ff0000'>Some text</body>");
.setBodyText("<body bgcolor='#ff0000'>Some text</body");

But that only puts the background color behind the text and does not fill the entire screen in height.

I have also tried putting the component in CENTER of a BorderLayout to make it fill the entire screen. Still no go.

Best would be if I can just make the background in the HTMLComponent transparent, so that I can constroll the background from the container component. Is this possible?

Daniele Testa
  • 1,538
  • 3
  • 16
  • 34

1 Answers1

0

I managed to put a full screen background color by putting the HTMLComponent CENTER in a BorderLayout and then use this:

.setHTML("<html><body bgcolor='#eeee00'>This is some text</body></html>", "UTF-8", "", true);
Daniele Testa
  • 1,538
  • 3
  • 16
  • 34