TextArea shows content only when selecting text

14 views
Skip to first unread message

P5music

unread,
Dec 9, 2020, 1:49:43 PM12/9/20
to CodenameOne Discussions
My app has a form where a TextArea is inside a particuar layout.
This layout is not very complicated and the TextArea is at bottom.
The TextArea is populated with some multiline text.

What I experience is that the TextArea stays like empty, blank, unless I try to select the text I can imagine inside, then some text appears in a selected form, but it disappears.
If I click outside and the inside I see a momentary glimpse of all the content.

I also tried with putting it in a  BorderLayout but it is the same.

I created a test example with a similar layout, and I can see the text and the normal behaviour so I couldn't reproduce the issue.

So I ask, what could cause the issue? what can be some of the possible causes?
Thanks in advance

Shai Almog

unread,
Dec 9, 2020, 11:20:02 PM12/9/20
to CodenameOne Discussions
I guess the selected foreground of the text has a different color and the unselected version if probably white on white or something.

You can use the component inspector to see what's happening.

P5music

unread,
Dec 10, 2020, 4:32:28 AM12/10/20
to CodenameOne Discussions
Yes, I put
textArea.getStyle().setFgColor(0);
and now it works.
I see that default values are not what could be expected. But they also change. Indeed in the test example the content is visible but it has Bold characters. 
It has to do with the theme but I see that in the test example also other textfields have the same Bold theme, while in my app just the TextArea had white text.
Regards

Dave Dyer

unread,
Dec 10, 2020, 12:22:53 PM12/10/20
to CodenameOne Discussions
I suspect there is an opaque container in the textarea's parent chain.
Reply all
Reply to author
Forward
0 new messages