I want to make sub Table
in a Cell
to fill to that cell as a parent.
// Main Table
Table mainTable = new Table();
// Sub Table
Table subTable = new Table();
mainTable.add( ).expand().row(); // cell-1
mainTable.add(subTable).expand().row(); // cell-2
mainTable.add( ).expand().row(); // cell-3
The Code result:
When I make subTable.setFillParent(true)
, it will fill to mainTable
. Ok its well.
But I want to make subTable
fill to expand size of the cell-2
.
I mean:
How can I make this?
Check LibGDX wiki: https://github.com/libgdx/libgdx/wiki/Table#fill
The fill method causes a widget to be sized to the cell. Like expand, there are also fillX and fillY methods.
table.add(nameLabel).expand().bottom().fillX();
...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.