列表表格外包一层容器(容器 setFillParent + 表格 expand/fill),让表格铺满 ScrollPane 视口(绿框=红框)

This commit is contained in:
tianmo committed 2026-10-16 17:37:47 +08:00
1 parent 3b5e80f991
commit a0c1b13a47
1 file changed
+9 -1
+9 -1
View File
@@ -91,7 +91,15 @@ public final class ObjectPanel {
// 列表内容靠左上:ScrollPane 里控件比视口小时默认会居中,看起来就像"列表跑到中间/下面"
call(state.listTable, Obf.TABLE_TOP, new Class<?>[0], tableClass);
call(state.listTable, Obf.TABLE_LEFT, new Class<?>[0], tableClass);
Object scroll = scrollClass.getConstructor(actorClass, skinClass).newInstance(state.listTable, skin);
// 给列表表格包一层容器:容器填满 ScrollPane 视口(=红框),列表表格再 expand/fill 填满容器,
// 这样"绿色(表格)"就跟"红色(视口)"一样大。
Object wrapper = tableClass.getConstructor().newInstance();
call(wrapper, Obf.TABLE_SET_FILL_PARENT, new Class<?>[] {boolean.class}, void.class,
Boolean.TRUE);
Object wrapperCell = call(wrapper, Obf.TABLE_ADD, new Class<?>[] {actorClass}, cellClass,
state.listTable);
layoutCell(wrapperCell, Obf.CELL_TOP, Obf.CELL_FILL_X, Obf.CELL_FILL_Y, Obf.CELL_EXPAND);
Object scroll = scrollClass.getConstructor(actorClass, skinClass).newInstance(wrapper, skin);
state.listScroll = scroll;
makeTouchable(scroll);
attachEventProbe(scroll, "listScroll");