Libgdx 表布局中的缩放图像角色不展开单元格

Libgdx 表布局中的缩放图像角色不展开单元格,libgdx,scene2d,Libgdx,Scene2d,很抱歉标题太多: 假设我有一个这样的形象演员: Image image = new Image(texture); image.setScale(2); 将其添加到表中可以正常工作并显示,但图像的缩放不会扩展表的大小 table.add(image); table.add(anotherimage); //these images are now overlapping because 'image' is too large for its cell table.add(image).fi

很抱歉标题太多:

假设我有一个这样的形象演员:

Image image = new Image(texture);
image.setScale(2);
将其添加到表中可以正常工作并显示,但图像的缩放不会扩展表的大小

table.add(image);
table.add(anotherimage);
//these images are now overlapping because 'image' is too large for its cell
table.add(image).fill().expand();

这是一个已知的问题,有什么方法可以解决吗?

尝试设置图像单元格的宽度/高度,使其适合表格。

尝试设置图像单元格的宽度/高度,使其适合表格

table.add(image);
table.add(anotherimage);
//these images are now overlapping because 'image' is too large for its cell
table.add(image).fill().expand();
填充是指图像填充单元格

展开是指单元格在可用空间上展开

填充是指图像填充单元格


展开是指单元格在可用空间上展开

试着设置图像的宽度和高度你试过了吗?这也不起作用。请尝试设置图像的宽度和高度。是否尝试过?实际上,我只需要设置图像单元格的宽度和高度。如果你想更新你的答案,我可以接受。实际上,我只需要设置图像单元格的宽度和高度。如果你想更新你的答案,我可以接受。