Add an image at the centre of the Navigation Bar

I am interested in replacing the title at the top of one of my views with an image as some apps do, for example the Twitter app:

This looks like the way to do it in Objective-C:

http://stackoverflow.com/questions/28212874/how-to-add-a-image-at-the-center-of-navigationbar-in-objective-c

I was wondering whether anybody had come across a declare for this?

Yes, exactly like that! Thank you Jean-Paul. :slight_smile:

To make it work in 64-bit, do I just need to do this:

#if Target32Bit
    dim rc as NSRect
#elseif Target64Bit
    dim rc as NSRect64
#Endif

?

Ah yes, the old initWithFrame. :wink:

Thanks again Jean-Paul. I can’t wait to put the logo in the nav bar of my app. :slight_smile:

Why this picture is so bad? If I use the same picture in the view it looks better.

You’ll need to pass the scale factor when creating the iOSBitmap and supply retina images.

The original picture is 250 pixel. And the result is not good.

Yes but it’s being drawn on a bitmap at a 1:1 scale. This is easily fixed in a production app. Jean-Paul was only creating a demo to show the declares to put the image into the nav bar.