我一直在尝试通过设计选项卡中的设计列表元素上的虚拟数组来创建循环。我看到数组正被加载到循环中。我似乎不能把表项放在另一个的下面。
在尝试了很长一段时间后,有人能指出我做错了什么吗?
for title in titleArray
newItem = titleArray[title] = listItem.copy()
newItem.y=(newItem.height)*title+58
newItem.parent= scroll.content
listItem.parent = scroll.content发布于 2018-02-14 00:11:52
在迭代数组时,您将获得数组的元素而不是索引,要获得索引,可以在逗号后添加另一个变量:
for title, index in titleArray
newItem = listItem.copy()
newItem.y = newItem.height * index
newItem.selectChild("fieldTitle").text = title完整示例如下:https://framer.cloud/BAnEq
https://stackoverflow.com/questions/48746989
复制相似问题