nativescript 如何使元素对触摸事件透明

nativescript how to make element transparent to touch events

对于我的一个项目,我需要在 nativescript(IOS 应用程序)中的 google 地图上开发渐晕效果,所以我决定使用 png24 图像解决方案在 google地图视图。

<GridLayout id="appContainer">
        <MapView id="mapView"></MapView>
        <Image src="~/images/vignettage.png" style="width:100%; height:100%;"></Image>
</GridLayout>

现在显然我 运行 在尝试与地图交互时遇到了问题,触摸手势、平移手势等都被叠加图像接管了。

如何使此图像对触摸事件透明,就像 css pointer-events:none; 在网站中对光标事件所做的一样。

欢迎任何 typescript.javascript 或纯 objective-c 解决方案!

刚刚添加了一张图片来说明这个问题:

这与 iOS 和 Android 如何处理事件冒泡有关。对于 iOS 你应该放 ios:isUserInteractionEnabled="false" 在覆盖模板上让事件通过。