如何删除 libgdx 中 table 顶部的空白 space

How can i remove a blank space at the top of a table in libgdx

我一直在尝试删除libgdx table开头的空白space(它是table里面的table里面一个滚动面板)。

我在这件事上唯一发现的就是删除那行

setFillParent(true);

而且我的代码中没有任何地方

这是我添加到 table

colorTable.add(colorTitleBar).width(350).height(120);
colorTable.row();
colorTable.add(colorChoices).width(350).height(120);
colorTable.pack();

这是颜色问题的屏幕截图 table

谁能帮我解决这个问题?

你可以这样做:

// set padTop if you want to leave some space at the top
colorTable.add(colorTitleBar).width(350).height(120).expandY().top().padTop(...);
colorTable.row();

并查看 LibGDX wiki 以获得 Table