1
我的代碼中有一個tap
事件。其母公司(不是直接父母)也有tap
事件。在Android中,一切正常。但在ios
中,事件向上傳播給該父項。如何停止該事件傳播(例如event.stopPropagation()
在javascript
)。在NativeScript中停止事件傳播ios點擊事件
示例XML代碼:
<StackLayout tap="newsDetails" data-args="{{ $value }}">
<StackLayout orientation="horizontal" >
<Label text="Share" class="icon" tap="shareNews" data-args="{{ $value }}"/>
</StackLayout>
</StackLayout>
注:我使用NativeScript核心
謝謝。
有沒有其他解決方案來做到這一點,因爲它不符合我的要求。 – SaiUnique
不 - 這只是事件傳播在iOS上的工作方式。看到這個https://stackoverflow.com/questions/16067865/propagating-touch-events-through-sibling-subviews –