how to set Label's text color (with getStyle().setFgColor())?

534 views
Skip to first unread message

Pai Peng

unread,
Aug 2, 2013, 11:01:55 AM8/2/13
to codenameone...@googlegroups.com
Hello CN1,


I need change the font color in the Label to white. By testing with simulator, I can make it work by using the setFgColor() function
getStyle().setFgColor

for Style().

But by testing on Android device 4.2.2, there is a lighter white background for the Label.

How to set the Label text color correctly? or could it be a bug in CN1?

(not yet tested on any iOS device)

Regards,

Pai


Pai Peng

unread,
Aug 2, 2013, 12:02:00 PM8/2/13
to codenameone...@googlegroups.com
Hello all,

I need set 
.getStyle().setBgTransparency(0, true);

to make the work on android device.


I really hope that the simulator of CN1 do exactly what real devices do.


Regards,

Pai

Shai Almog

unread,
Aug 2, 2013, 1:52:57 PM8/2/13
to codenameone...@googlegroups.com
If you would have tested with the XOOM simulator you would have gotten that result.
You should not use getStyle() but instead use getUnselectedStyle() (and selected/pressed etc. as necessary).
Reply all
Reply to author
Forward
0 new messages