1
votes

I have a Xamarin'application with master detail page and I would like to have on ios, android and uwp the hamburger icon for the menu.

Now I'm using the sample found on xamarin site to create the master detail page.

On android the icon is visible without doing anything: enter image description here

On ios (and UWP) isn't visible:

enter image description here

Why on ios and UWP there is this behavior? How can I have the icon on all three platform?

Thanks!

EDIT: I haven't include any image, nor for android nor for ios and UWP.

1
Will you please post the code you're using for your iOS and UWP views?Jacob Barnes
@JacobBarnes Hi, all my view code is in PCL solution. Here a link with all page that compose the master page ufile.io/y5azoHikari
The PCL solution should have no UI code in it as it would be impossible to share between the various devices. The PCL is meant to share code commonly used between the devices, such as a data access layer. I'm not sure what you mean when you say all the view code is in the PCL because that wouldn't work. Unless you've just stored the views in the PCL project, but if that's the case, please post that code.Jacob Barnes
Here the full code: ufile.io/vk61oHikari

1 Answers

2
votes

I have tested the codes and found that it was caused by the outer NavigationPage. You are currently nesting MasterDetailPage inside NavigationPage, which caused the disappearance of the toggle button.

So, the solution is easy, simply modify the following line of code in LoginPage.xaml.cs:

await Navigation.PushAsync(new MasterDetailAppPage());

To this:

App.Current.MainPage = new MasterDetailAppPage();

Update:

In iOS, xamarin doesn't provide toggle button icon by default, you need to set it manually on the MasterPage. ie in MasterDetailAppPageMaster.xaml:

<ContentPage 
         ...
         Icon="hamburger.png"
         Title="{sgat:Translate appName}">

and add your icon image as resource into Resources folder of iOS project. but I've already seen hamburger.png in your project. So you can use this directly.