TextField in InteractionDialog has wrong bg color

29 views
Skip to first unread message

P5music

unread,
Dec 15, 2020, 11:06:09 AM12/15/20
to CodenameOne Discussions
I am using InteractionDialog to create a little dialog for the user to input a text value.
It works but I see that the InteractionDialog is transparent, and the TextField is transparent too, foreground color is black for the TextField but I need that its background is white.
I tried to set the background color and the setOpaque(true) but the TextField is not affected at all, it is the same.

editText.getStyle().setBgColor(65536 * 255 + 256 * 255 + 255); //couldn't use Color.WHITE
/or editText.getStyle().setBgColor(ColorUtil.WHITE); doen't change the bg color
editText.setOpaque(true);

What's wrong?
Thanks, regards

Shai Almog

unread,
Dec 15, 2020, 10:48:11 PM12/15/20
to CodenameOne Discussions
How did you set the transparency of the interaction dialog?

P5music

unread,
Dec 16, 2020, 4:29:04 AM12/16/20
to CodenameOne Discussions
I used the defaut valuse

but also using
textParameterValueDialog.setOpaque(true);
textParameterValueDialog.getStyle().setBgColor(ColorUtil.WHITE);
textParameterValueDialog.getStyle().setOpacity(100);
textParameterValueDialog.getDialogStyle().setOpacity(100);

it is transparent.
Regards

Shai Almog

unread,
Dec 16, 2020, 10:34:35 PM12/16/20
to CodenameOne Discussions
Opacity is applied to an entire hierarchy and will impact the children too.

P5music

unread,
Dec 17, 2020, 4:17:41 AM12/17/20
to CodenameOne Discussions
So why does it not work?

Shai Almog

unread,
Dec 17, 2020, 11:55:41 PM12/17/20
to CodenameOne Discussions
You set opacity to 100. It applies to the entire hierarchy.

P5music

unread,
Dec 18, 2020, 3:49:22 AM12/18/20
to CodenameOne Discussions
Nothing becomes opaque after setting the 100 value, this is what I am trying to convey to you.
Regards

Shai Almog

unread,
Dec 19, 2020, 12:57:38 AM12/19/20
to CodenameOne Discussions
Opacity is between 0 - 255 (0xff) and you set it to translucent: 100.
Reply all
Reply to author
Forward
0 new messages