这段代码对我有用。
if (UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
{
UINavigationBarAppearance appearance = new UINavigationBarAppearance();
var img = UIImage.FromBundle("navbar_image").CreateResizableImage(UIEdgeInsets.Zero, UIImageResizingMode.Stretch);
appearance.BackgroundImage = img;
appearance.TitleTextAttributes = new UIStringAttributes { ForegroundColor = UIColor.White };
appearance.BackgroundColor = UIColor.Blue;
NavigationController.NavigationBar.CompactAppearance = appearance;
NavigationController.NavigationBar.StandardAppearance = appearance;
NavigationController.NavigationBar.ScrollEdgeAppearance = appearance;
}
else
{
var img = UIImage.FromBundle("navbar_image").CreateResizableImage(UIEdgeInsets.Zero, UIImageResizingMode.Stretch);
NavigationController.NavigationBar.SetBackgroundImage(img, UIBarMetrics.Default);
this.NavigationController.NavigationBar.Translucent = false;
}