I have an app using a master detail page and a navigation page within it, on Android when you navigate via the burger menu the nav bar stays at the top of the screen as expected so you can navigate using it. On iOS the nav bar doesn't stay there, so I've created a custom bar with a burger menu icon. When someone clicks the burger icon I want the burger menu to swipe out from the left.
I've attached a gesture recogniser to the burger icon but I don't know what to put in the called method to make it perform the swipe action.
Nav bar on second page:<StackLayout IsVisible="{Binding _isiPhone}" Orientation="Horizontal" BackgroundColor="#008334"> <Image Source="burger.png" HorizontalOptions="StartAndExpand"> <Image.GestureRecognizers> <TapGestureRecognizer Tapped="Burger_Clicked"></TapGestureRecognizer> </Image.GestureRecognizers> </Image> </StackLayout>
Event handler;private void Burger_Clicked(object sender, EventArgs e) { }
Please see attached images for burger menu view an Android view.
Try MasterDetailPage's IsPresented
https://developer.xamarin.com/api/type/Xamarin.Forms.MasterDetailPage/
Answers
@NinjaFocks I think you need create a animation to go to left the control. Read this article to get more info. https://blog.xamarin.com/creating-animations-with-xamarin-forms/
@josemmortega I don't need to animate anything, I just need to make the burger menu appear which is being done by the swipe method. I need to call the swipe method or gesture from the event handler.
OK, I understand incorrectly. To include swipe gesture you need to use www.mrgestures.com because in Xamarin.Forms it's not implemented yet.
Try MasterDetailPage's IsPresented
https://developer.xamarin.com/api/type/Xamarin.Forms.MasterDetailPage/
Thanks @Vulcan this was the solution in the end. I struggled to work out how we'd get access to it but we managed to work it out in the end.