Customize your navigation bar with MonoTouch by adding an image

Is there a way to customize the navigation bar using monoTouch? I'm trying to add an imageView to it, but unfortunately it doesn't work. Here is my code:

imageView = new UIImageView();
var image = UIImage.FromFile("image.png");
var small = image.Scale (new SizeF (35f, 35f));
imageView.Image = small;
NavigationItem.TitleView = imageView;

      

+3


source to share


1 answer


I did it. I confused with passing an image to a view. This is how it works.



var image = UIImage.FromFile("image.png");
var small = image.Scale (new SizeF (35f, 35f));
UIImageView imageView = new UIImageView(small)
NavigationItem.TitleView = imageView;

      

+9


source







All Articles