使用Corona sdk将表格插入组中。

如何将表格插入到组中?

我需要插入以下内容:

    local images = {
    "rowName.img[1]",
    "rowName.img[2]",
    }

到一个像这样的组中:

    group:insert(images)

同样地,我知道 group:insert 不适用于表格。我尝试使用:

    group.images = images

但我不知道我是否做得正确。

点赞
用户1078537
用户1078537

你可以使用 for 循环遍历你的图片数组,并且逐一地将它们插入到组中:

for i=1, #images do
    table.insert(group, images[i])
end
2014-08-25 18:11:44