Is there an easy way to make elements in tripleplay wrap and continue below?
For example if I have this code:
Group letters = new Group(AxisLayout.horizontal(), Style.HALIGN.left);
letters.addStyles(Styles.make(Style.TEXT_WRAP.is(true)));
root.add(letters);
for (int i = 0; i < 100; i++) {
letters.add(new Label(""+i));
}
That would show some numbers (up to, say, 30) and the rest of the numbers will dissappear off-screen, what I want to have is something like:
01 02 03 ... 28
29 30 31 ... 50
So whatever component doesn’t fit on screen will be added below. I tried a few settings but wasn’t able to get it
Thanks
Style.TEXT_WRAPis only applicable toLabels. There is no equivalent in Tripleplay UI of Swing’sFlowLayoutwhich is what I think you want.If you really just want to lay out a bunch of text, then just stick it all in one label with text wrapping enabled. But if you’re trying to layout actual user interface elements in a flow, then you’ll need to write your own
FlowLayout. You can also useTableLayout, but that requires that you know how many columns you want in advance.I’ve always found
FlowLayoutto be a weird way to lay out user interfaces, and have never had a need for it, hence I did not write one for Tripleplay UI.