Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Form : Master Detail Page : How to disable swipe gesture to load the menu on iOS

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.

like image 656
LittleFunny Avatar asked Nov 09 '16 21:11

LittleFunny


3 Answers

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.

like image 61
LittleFunny Avatar answered Nov 06 '22 12:11

LittleFunny


For this, you need to write IsPresented = true along with

#if __IOS__
IsGestureEnabled = false
#endif
like image 41
user2964251 Avatar answered Nov 06 '22 12:11

user2964251


On MasterDetailPage you add this:

protected override void OnAppearing()
{
    base.OnAppearing();

    if (Device.RuntimePlatform == Device.iOS)
    {
        IsGestureEnabled = false;
    }
}
like image 3
testing Avatar answered Nov 06 '22 11:11

testing