How do I change the Xamarin return button on the menu bar?
2 answers
You can change the arrow to a hamburger icon if you use MasterPage
in the NavigationPage:
Detail = new NavigationPage(masterPage);
If you want to hide the icon, this only applies to Android. It can be solved with a custom renderer ( http://developer.xamarin.com/guides/cross-platform/xamarin-forms/custom-renderer/ ):
[assembly:ExportRenderer (typeof(NavigationPage), typeof(CustomNavigationRenderer ))] public class CustomNavigationRenderer : NavigationRenderer { protected override void OnElementChanged(ElementChangedEventArgs<NavigationPage> e) { base.OnElementChanged (e); var actionBar = ((Activity)Context).ActionBar; actionBar.SetIcon (Resource.Color.Transparent); } }
To change the icon, just change the project files:
- YourProject / Resources / draw / icon.png
- YourProject / resources / extractor-hdpi / icon.png
- YourProject / resources / extractor-xhdpi / icon.png
- YourProject / resources / extractor-xxhdpi / icon.png
or MasterDetailPage
set the property Icon
to another resource in yours.
+3
source to share