Disable scrollview scroll events


#1

First of all thanks for your attention about this thread.

Here is my problem : I have a Google map inside a ScrollView layout. Everything is working fine on iOS, the ScrollView scrolls and the map is fully usable.

However on android, when a touch event is raised from the map, the scroll view’s gesture events will trigger first and will dismiss the map one. Thus it is impossible to use the map inside the scroll view.

To solve this problem, I thought to simply disable the scrollview’s event so the map’s one could be handled. After many searches I found this question which could do the trick, but has simply no effect.

There is my code :

@ViewChild("mainScrollView") mainScrollView : ElementRef;


ngAfterViewInit() {
    this.disableScrollView()
}

private disableScrollView(){

    const scrollView: ScrollView = this.mainScrollView.nativeElement;

    console.log("scroll view :")
    console.dir(scrollView)

    if (isAndroid) {
        console.log("is Android")
        scrollView.android.requestDisallowInterceptTouchEvent(true);
    }
}

More globally, I know this problem affects every layout having gestures inside a ScrollView. So it would be great to have a workaround fixing this problem !

PS : My project is working on Nativescript 3.3.0 with Angular.