I have taken my working Navigation Renderer and added setting the Back Button to an image and it is not working. I am getting the word Back instead of the desired image. Here's my code:
using System;
using UIKit;
using Xamarin.Forms;
using Xamarin.Forms.Platform.iOS;
using myapp.iOS;
[assembly:ExportRenderer (typeof(NavigationPage), typeof(CustomNavigationRenderer))]
namespace myapp.iOS
{
public class CustomNavigationRenderer : NavigationRenderer
{
public override void ViewDidLoad()
{
base.ViewDidLoad ();
NavigationBar.SetBackgroundImage (UIImage.FromBundle ("header"), UIBarMetrics.Default);
UIBarButtonItem but = new UIBarButtonItem (UIImage.FromBundle ("icon-back"),
UIBarButtonItemStyle.Plain,
(sender, args) => {
NavigationController.PopViewController (true);
});
NavigationItem.SetLeftBarButtonItem(but, true);
}
}
}
I trap the code at the last line and see that the button has been created. However, the image does not appear.
Suggestions???
PS: NavigationItem.LeftBarButtonItem = but;
did not work either.