Files
Martin Guillon a2d06a9efe fix(button): ios let the gesture observer handles tap events
in some weird cases like i some UICollectionView layouts the UIControlEvents.TouchUpInside is failing
2021-03-18 14:00:36 +01:00

23 lines
483 B
TypeScript

import { StackLayout, Label, Button, EventData } from '@nativescript/core';
import { tapEvent } from '@nativescript/core/ui/button';
export class MyControl extends StackLayout {
constructor() {
super();
var counter: number = 0;
var lbl = new Label();
var btn = new Button();
btn.text = 'Tap me!';
btn.on(tapEvent, (args: EventData) => {
lbl.text = 'Tap ' + counter++;
});
this.addChild(lbl);
this.addChild(btn);
this.className = 'MyStackLayout';
}
}