SpanLabel Container extension problem

27 views
Skip to first unread message

CS

unread,
Jul 28, 2016, 4:18:39 PM7/28/16
to CodenameOne Discussions
Dear CNO,

I have a Container with Y scrolling enabled to which I add a SpanLabel (Y-layout) with some text in it.
The problem is that the Container extension is dependent of the size of the text in SpanLabel (but not correctly).
Meaning if text is of length x, the Container extends as it should, so all SpanLabel text is shown, but if text length is x-1 the last Container extends one row to little, meaning the last row (usually it is about a half of the line) is not shown. 
To further prove that the problem is in correlation between SpanLabel and Container I have added two SpanLabels (one after the other in Y-layout) with the same text inside. If the text length is x, then both SpanLabels are shown as expected, but if text is of length x-1 then the second SpanLabel is missing TWO rows (the Container has extended 1 row for each SpanLabel to little).

This is observed on Android, but it works ok on Simulator.

Best regards,
CS


Shai Almog

unread,
Jul 29, 2016, 1:15:51 AM7/29/16
to CodenameOne Discussions, computer.s...@gmail.com
Hi,
I wrote a blog post explaining just why multi-line strings are such a hard problem to solve correctly for all cases: https://www.codenameone.com/blog/the-challenge-of-multiline-strings.html

From your description I understand the problem isn't the span label but the BoxY layout size. So the obvious question is, what is the parent of the box Y. I'm assuming it's a flow layout which you should replace with something more robust e.g. center of border layout.
Reply all
Reply to author
Forward
0 new messages