Matt
Matt

Reputation: 147

Nativescript Gestures not working on android views with ScrollViews

Hello I have a AbsoluteLayout with a (pan)="onPan($event)" gesture on it.

I noticed if I have a ScrollView on the page and you try to pan from the scroll view the onPan event is no longer triggered. This only happens on android, it works perfectly on IOS.

  <AbsoluteLayout width="100%" (pan)="onPan($event)">
    <StackLayout left="{{tabs.store.left}}" height="100%" width="100%">
        <store></store>
    </StackLayout>

    <StackLayout left="{{tabs.profile.left}}" height="100%" width="100%" class="StaticBg">
      <profile></profile>
    </StackLayout>
  </AbsoluteLayout>

My store component has a ScrollView and you can't pan from that page on android. Any help would be greatly appreciated!

Upvotes: 3

Views: 433

Answers (1)

Manoj
Manoj

Reputation: 21908

By nature Android's ScrollView operates by intercepting it's touch events. So you might have to add the pan event to ScrollView / it's child component.

Upvotes: 3

Related Questions