1
是否可以在應用程序運行時更改NiftyGui中面板的大小?我想這樣的代碼: //init
NiftyGui - 如何更改面板的大小
mainScreen = new ScreenBuilder("main") {{
controller(sc);
layer(new LayerBuilder("foreground"){{
childLayoutCenter();
panel(new PanelBuilder("p1"){{
childLayoutAbsoluteInside();
backgroundColor("#00ff00");
width("100%");
height("100%");
padding("10px");
panel(new PanelBuilder("p4"){{
x("100%");y("100%");
height("20%");
width("20%");
backgroundColor("#0000ff");
}});
}});
}});
}}.build(nifty);
//update()
Element f = nifty.getCurrentScreen().findElementById("p4");
f.getParent().layoutElements();
f.setHeight(f.getHeight() + 300);
並沒有什麼正在發生變化。
你試過了嗎? – d3dave 2015-04-04 21:19:44
當然,我失敗了。 – gusili 2015-04-05 04:20:23