Reputation: 35
I am trying to remove the android actionbar icon in a Xamarin android project.
I have tried setting the icon as transparent and excluding the icon from the manifest. I have also tried changing the icon size to try and hide it and replacing it with a blank icon. Problem is that this also makes the icon in the launcher menu screen blank.
any suggestions would help
Thanks
Upvotes: 2
Views: 2974
Reputation: 36
Try to use the below code, it worked perfectly for me
ActionBar.SetIcon(null);
Upvotes: 1
Reputation: 189
I've got this solved by adding this code into my Android MainActivity class:
ActionBar.SetIcon(Android.Resource.Color.Transparent);
Upvotes: 1
Reputation: 498
For a particular activity try this...
getActionBar().setIcon(
new ColorDrawable(getResources().getColor(android.R.color.transparent)));
Upvotes: 1
Reputation: 89102
in your MainActivity.cs, try this
// hide app icon in Android action/nav bar
ActionBar.SetIcon(my_app_name.Resource.Color.transparent);
Upvotes: 1