玩N +三重播放布局

发布于 12-23 04:40 字数 511 浏览 3 评论 0原文

有没有一种简单的方法可以使三重播放中的元素包装起来并继续下面的内容?

例如,如果我有这样的代码:

    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));
    }

这将显示一些数字(最多,比如说 30),其余的数字将消失在屏幕外,我想要的是这样的:

01 02 03 .. 28
29 30 31 ... 50

因此,任何不适合屏幕的组件都会添加到下面。我尝试了一些设置,但无法获得它,

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

肩上的翅膀2024-12-30 04:40:08

Style.TEXT_WRAP 仅适用于Label。 Swing 的 FlowLayout 的 Tripleplay UI 中没有等效项,我认为这就是您想要的。

如果您确实只想布置一堆文本,那么只需将其全部粘贴到一个标签中并启用文本换行即可。但是,如果您尝试在流程中布局实际的用户界面元素,那么您需要编写自己的 FlowLayout。您还可以使用TableLayout,但这要求您提前知道需要多少列。

我一直发现 FlowLayout 是一种奇怪的用户界面布局方式,并且从来没有需要它,因此我没有为 Tripleplay UI 编写一个。

Style.TEXT_WRAP is only applicable to Labels. There is no equivalent in Tripleplay UI of Swing's FlowLayout which 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 use TableLayout, but that requires that you know how many columns you want in advance.

I've always found FlowLayout to 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文