I have the following code:
SelectBox<String> saves = new SelectBox<>(Game.skin);
saves.setItems(files);
saves.setWidth(300);
saves.setHeight(50);
saves.pack();
saves.setPosition(Gdx.graphics.getWidth() / 2f - saves.getWidth(), Gdx.graphics.getHeight() / 3f * 2);
stage.addActor(saves);
However, it still stays the same size. I have also tried saves.setSize(300, 50)
, but it doesn't work either. How can I fix this?
question from:
https://stackoverflow.com/questions/65557774/selectbox-not-scaling 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…