2

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

Avi K.
  • 1,734
  • 2
  • 18
  • 28
Shaun
  • 35
  • 1
  • 7

4 Answers4

1

in your MainActivity.cs, try this

    // hide app icon in Android action/nav bar
    ActionBar.SetIcon(my_app_name.Resource.Color.transparent);
Jason
  • 86,222
  • 15
  • 131
  • 146
1

For a particular activity try this...

getActionBar().setIcon(
   new ColorDrawable(getResources().getColor(android.R.color.transparent)));
Harry Mad
  • 488
  • 5
  • 17
1

I've got this solved by adding this code into my Android MainActivity class:

ActionBar.SetIcon(Android.Resource.Color.Transparent);
kjellberg
  • 179
  • 2
  • 4
0

Try to use the below code, it worked perfectly for me

ActionBar.SetIcon(null);
Atef Hares
  • 4,715
  • 3
  • 29
  • 61
Vukzrito
  • 26
  • 3