0
次のコードを使用してScrollPaneでテーブルを作成しています。空になったときに正しく表示されますが、アイテムをテーブルに追加すると、その高さは約半分になります。LibGDX Actorを追加した後にテーブルの高さが変化する
// Init Stage & container table
stage = new Stage(new StretchViewport(Consts.SCREEN_WIDTH, Consts.SCREEN_HEIGHT));
Table container = new Table();
stage.addActor(container);
container.setFillParent(true);
// Init the scrollable table
final Table yourTurnMatches = new Table();
yourTurnMatches.background(Assets.getSolidColorDrawable(Color.GRAY));
final ScrollPane yourTurnMatchesScroll = new ScrollPane(yourTurnMatches);
yourTurnMatchesScroll.setScrollingDisabled(true, false);
yourTurnMatches.defaults().expand().space(4).top();
// Add the inner content to the container table
container.row().top().expandX().uniform();
Table matchTitles = new Table();
matchTitles.row().expandX().uniform().padTop(10).padBottom(10);
matchTitles.setBackground(Assets.getSolidColorDrawable(Color.DARK_GRAY));
matchTitles.add(txtYourTurn);
matchTitles.add(txtTheirTurn);
matchTitles.add(txtFinished);
container.add(matchTitles).colspan(3).fillX();
container.row().top().expand().uniform().spaceLeft(5).spaceRight(5);
container.add(yourTurnMatchesScroll).fill();
yourTurnMatches.row();
// Add button (this causes the Table height to go to about half of the original height)
Button btn = new Button(greenButtonStyle);
yourTurnMatches.add(btn).width(target.getWidth()*0.8f);
私はLibGDXバージョン1.9.2を使用しています。
テーブルの高さを変更する原因は何ですか?
ありがとうございました!