问题
I need the screen to draw stuff on it. Since I have a Master Detail Page on the same screen, whenever I draw in a direction as opening the menu, the menu will swipe open at the same time as I draw.
Is there a way to stop it from swipe open, but still have the menu button clickable to open it.
回答1:
I found the solution:
#if __IOS__
IsGestureEnabled = false
#endif
Setting Is GestureEnabled to false will stop from the menu being swiped open. This value only can be set for iOS. If I set for android, the menu button will not open the menu when clicked.
回答2:
For this, you need to write IsPresented = true along with
#if __IOS__
IsGestureEnabled = false
#endif
回答3:
On MasterDetailPage
you add this:
protected override void OnAppearing()
{
base.OnAppearing();
if (Device.RuntimePlatform == Device.iOS)
{
IsGestureEnabled = false;
}
}
来源:https://stackoverflow.com/questions/40515952/xamarin-form-master-detail-page-how-to-disable-swipe-gesture-to-load-the-men