Sleep Paralysis
Sleep Paralysis

Reputation: 469

Add image to uinavigation item

I am working on a ipad app where I am trying to style the navigation item(add an image) of a table view in a storyboard. (following this youtube link https://www.youtube.com/watch?annotation_id=annotation_971346&feature=iv&src_vid=edDoXNQrBX8&v=9Pp-Vz-A7bo )

I noticed that there is no image property for the navigation item, so i embedded it in a navigation controller.(set it as the initial view, set the image(navbar.png as you see in the pic, set it's name as test ) However, after i run the program in the simulator, my image does not show up and the title is "Peter" not "test" .

Ive also tried dragging a navigation bar unto the "recipeList" but it does not let me. I added an image that i believe shows my entire storyboard so I Would appreciate it if I could get any insight into this.

Thank you

Update In case I was confusing, i am simply trying to get an image where i have the text "peter"

enter image description here

Upvotes: 0

Views: 64

Answers (1)

Mutawe
Mutawe

Reputation: 6524

Use the following:

UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"yourImage.png"]];
self.navigationItem.titleView = imageView;

Upvotes: 1

Related Questions