I'm trying to add label hereLibgdx添加小區到表
Label missionTitle = new Label(mission.title, skin);
Label missionDesct = new Label(mission.desct, skin);
Label remainDay = new Label(TaskManager.getRemainMissionDay(mission.deadLine) + "day remain", skin);
missionDesct.setFontScale(width * 1.4f/1080);
remainDay.setFontScale(width * 1.2f/1080);
missionDesct.setWrap(true);
Table table = new Table();
table.debug();
table.background(new TextureRegionDrawable(new TextureRegion(new Texture("image/imgray.png"))));
table.add(missionTitle).width(width/1.1f);
table.row();
table.add(missionDesct).width(width/1.1f);
table.row();
table.add(remainDay).width(width/2.3f).left();
對於我正在添加此線;
Label goldLabel = new Label("30 gold", skin);
table.add(goldLabel);
但結果是; this
如何在那裏添加一個新的單元格? 我試圖添加「.width(width/2);」但它不起作用。
...
table.row();
table.add(remainDay).width(width/2.3f).left();
Label goldLabel = new Label("30 gold", skin);
table.add(goldLabel).width(width/2.3f);
你可以試試這個table.add(remainDay,goldLabel); ? – Sneh
不幸的是,它沒有奏效。 –