jkh
jkh

Reputation: 3678

Prevent Xamarin.Forms master page from sliding out for a single control

In my master-detail application, I have a ContentPage that has a horizontal ScrollView.

<ContentPage.Content>
  <StackLayout>
    <ScrollView Orientation="Horizontal">
     ...
    </ScrollView>
    <Grid>
      ...
    </Grid>
  </StackLayout>
</ContentPage.Content>

On iOS, the scroll view will only scroll to the left if I scroll it to the right first (to activate the ScrollView); otherwise, the scroll to the left is recognized as the swipe gesture to make the master flyout visible.

Is there any way to disable the swipe gesture from displaying the master page when it is done on the ScrollView? The rest of the page should display the master when this swipe gesture occurs.

Upvotes: 2

Views: 1527

Answers (1)

Adam
Adam

Reputation: 16199

You can stop the swipe out from the left via

MasterDetailPage.IsGestureEnabled = false;

You may be able to disable it or re-enable it depending upon the focus events of the ScrollView.

Upvotes: 5

Related Questions