UINavigationBar Custom Right Bar Button

I am adding a custom button with image on the right side of the UINavigationBar.
But unfornately does not succeed yet. The problem is that it always shows a rectangle of blue screen.
For your information the code is given:

        var customBtn = new UIBarButtonItem ();
        customBtn.Image = UIImage.FromFile ("home.png");
        customBtn.Clicked += (object sender, EventArgs e) => 
        {
            Console.WriteLine("This button is clicked");
        };

        NavigationItem.RightBarButtonItem = customBtn;

Thank you for your time.

Sign In or Register to comment.