tags:

views:

100

answers:

1

Hello,

I show an image on the navigation bar (I use UIImageView). Could you let me know how can I position it on a certain x, y location on the navigation bar?

Thanks.

+1  A: 

Assuming you're adding the UIImageView as a subview of the UINavigationBar view, you can use the UIView method initWithFrame: to choose a specific CGRect to draw the image view within. This method allows you to specify, in terms of the coordinate system of the superview, what rectangle your UIImageView should draw within.

For more info, see this Apple documentation page (must be registered as an iPhone developer).

Tim
Thanks. It works.
ebaccount
Now the problem is, if I push another view from this view (the one that is showing the image), the image appears at that view as well.Could you let me know how can I avoid that?
ebaccount
I fixed that by removing the image from its superview before displaying the new view
ebaccount