ewom2468
ewom2468

Reputation: 841

Labels keep having black background in codenameone

I have an app that uses a form which has a white background.The issue is that the labels on the form all have a black background which is not what i want at all. The code is:

     Welcome.getUnselectedStyle().setFgColor(0x0000ff);
     Welcome.getUnselectedStyle().setBgColor(0xffffff);
     Welcome.getUnselectedStyle().setBgTransparency(0);
     Welcome.getSelectedStyle().setBgTransparency(0);
     Welcome.getSelectedStyle().setFgColor(0x0000ff);
     form.setLayout(layout);
     form.getStyle().setBgColor(0xffffff);
     hi.addComponent(Welcome);

The "Welcome" label shows a black background...how can i prevent this?

Upvotes: 1

Views: 100

Answers (1)

Shai Almog
Shai Almog

Reputation: 52760

This:

 Welcome.getUnselectedStyle().setBgTransparency(0);
 Welcome.getSelectedStyle().setBgTransparency(0);

Made the background transparent. I guess you meant 255 for the rest of the code to make sense.

Upvotes: 2

Related Questions