Tag Archives: Xamarin Android ActionBar Icon

Argghh! Let’s get rid of the ugly Icon at the top NavigationBar in Andriod with Xamarin Forms…

Alright, no offence Android! 😉 You are an awesome platform, but sometimes I do not like the default App Icon you put up at the top left side of the Navigation Bar! 😦

I just implemented my beautiful looking Navigation Bar, but I hate that ugly Icon Android has put up by default! So I’m gonna get rid of it! ARRGHHH! lol 😛

Nexus 4 (Lollipop) Screenshot 1

Yep there you see ? how it’s making my beautiful navigation bar so ugly 😦

Alright, let’s get to work…

Custom Renderer for the rescue ? 😀

Yeah damn right, Custom Render it is!
We are going to Custom render the ContentPage the fish out of it. 😉 Haha

Seriously, we are going to create a custom render for the ContentPage of Xamarin Forms, so that during the runtime we could customize it’s properties the way we need. Keep in mind if you are using a subclassed version of ContentPage for your UI Pages, then I suggest you use that subclassed class here in the Renderer.

[assembly: ExportRenderer(typeof(ContentPage), typeof(ContentPageRenderer))]
namespace AwesomeNavigationBar.Droid.Renderers
    public class ContentPageRenderer : PageRenderer
        protected override void OnElementChanged(ElementChangedEventArgs<Page> e)

            // Removing AppIcon from the ActionBar (Xamarin Forms NavigationBar)
            var actionBar = ((Activity)Context).ActionBar;
            actionBar.SetIcon(new ColorDrawable(Xamarin.Forms.Color.Transparent.ToAndroid()));


As you can see inside the OnElementChanged event we are retrieving the default ActionBar of Android (Yes in Android they call it the ActionBar instead of NavigationBar in Xamarin Forms) and making the Icon invisible by setting a Transparent drawable object. Simple!

Yep there you go, you only need to add the above custom renderer in your Xamarin.Android project (Don’t be lazy! make sure to edit the namespace according to your project) lol 😉

Save it! Run it! 😀

Nexus 4 (Lollipop) Screenshot 2

WOHOOOO ! Now look at that beauty ! 😉

Alright fellas, ÇøŋfuzëРSøurcëÇødë out ! 😀

Stay Awesome !