Add image to a navigationItem's title

I'd like to add a logo to the left of my title on my navigation bar. The title property seems to only take an NSString. What's the best way to add an image to the navigation bar?

Answers


You can replace the title view with an image like this:

navigationItem.titleView = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"title_bar.png"]];

Need Your Help

Get a single field from multi-column ListView using SimpleAdapter

android listview arraylist listactivity simpleadapter

I have a ListActivity in which i have used a SimpleAdapter to create a list which has 2 fields. The pair of values are stored using a Map, and the list is an ArrayList.

CoreData optimization for big data

ios iphone xcode core-data

The fetching request inside the block taking around 9 minutes to process checked on instrument customerArray has around 60K objects and CusCustomerAddress Model has around 30k objects so I have to

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.