问题
On longPress event the tap event also executing
<StackLayout (longPress)="onLongPressItem(item)" (tap)="onItemTap(item)">...</StackLayout>
is there a way to prevent tap on longPress? I want to work both events on Same layout. In ListView we have 'itemTap' only is there a option for 'longPress'? Please don't suggest me RadListView.
回答1:
Maybe this answer is still helpful too. There exists issues concerning your problem:
- https://github.com/NativeScript/NativeScript/issues/2823
- https://github.com/NativeScript/NativeScript/issues/2977
In the first one, it is described how to manually fix it. In the second one, a contributor said that they will attempt to fix it in version 3.1.
来源:https://stackoverflow.com/questions/42228969/nativescript-tap-longpress-together-not-working