Relative tap position


Hello. I would like to ask you if is possible detect relative tap coordinates of image(or any element) starting by x=0 and y=0.

I need detect size of image (width and height) too.

Is it in Nativescript possible? For example I made it in HTML and JS


var gestures = require("ui/gestures");
var labelModule = require("ui/label");
var label = new labelModule.Label();
label.on(gestures.GestureTypes.touch, function (args) {
    console.log("Touch: x: " + args.getX() + " y: " + args.getY());


Thanks but I need it in Angular2/Typescript. And I need to detect size of element.


Only the import statement changes for TypeScript. You can directly attach touch listener to your elements declared in html file, just like any other events tap or loaded.

Use view.getActualSize() to find the size.