Background color cannot be changed

10 views
Skip to first unread message

P5music

unread,
May 11, 2021, 3:49:32 PM5/11/21
to CodenameOne Discussions
My CodenameOne app user interface has strange background color that I am not able to get rid of.
In the attached image you can see that the background is gray.
I want that it is white.
A general theme is what is loaded at startup.
Then
I made some attempts:
1 - I created an item for containers inside the main theme with background=gradient white->white
That caused that a white curtain covered all the user interface.
2 - I created another theme file: white_container_theme with just one item, the same of above for white container background
That also had no effect, it was assigned with the code provided below

Resources theme = null;
try {
theme = Resources.openLayered("/white_container_theme");
} catch (IOException e) {

}
area.setInlineStylesTheme(theme);
3 - assigned a bg color
area.getStyles().setBackGroundColor();

No one worked.

Notice that I have other items inside the main theme and they work, for example TextFields with border, but TextFields themselves have that gray background too and if I add with white->white gradient background to their item it has no effect.

Thanks in advance
container_area.png

Shai Almog

unread,
May 12, 2021, 12:29:06 AM5/12/21
to CodenameOne Discussions
Containers must always be transparent. Doing something like that will cause serious side effects and destroy your performance. Using gradients from white to white would also cause such an issue.
There's no getStyles() method.
I'm guessing you didn't use setBgTransparency to 255.
Reply all
Reply to author
Forward
0 new messages