var gestures = require("ui/gestures");
for (var i = 0; i < images.length; i++) {
imgArray[i] = new imageModule.Image();
imgArray[i].id = "img";
imgArray[i].width = w / 6;
imgArray[i].height = h / 7;
imgArray[i].src = images[i];
imgArray[i].stretch = "fill";
wrap_layout.addChild(imgArray[i]);
imgArray[i].on(gestures.GestureTypes.tap, function (args) {
console.log("tap"+"|"+i);
});
这是我在nativescript上将图像数组添加到WrapLayout的循环运行良好我的问题是我正在尝试为每个图像实现轻敲手势是有效的,但不知道图像的特定索引如何解决它