Iphone/Ipad Add Image and Text to Navigation Title
-
I am simply trying to add an image and text to the navigationItem title. This is what I am doing, but it only shows the image and not the title. This seems like it would be pretty easy. Example ( self.navigationItem.titleView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logo_small_white.png"]] autorelease]; self.navigationItem.title = @"Company";
-
Answer:
By setting a custom title view, you're replacing the standard view that normally shows the title text. From the documentation for titleView in UINavigationItem: If you set this property to a custom title, it is displayed instead of the title. So you need to add your own view (possibly a UILabel) to display your title — one way of doing this would be to add a UILabel and the UIImageView above as subviews of a container UIView, and set that as the titleView.
smcdrc at Stack Overflow Visit the source
Related Q & A:
- How to add background image from OpenGL ES to iPhone?Best solution by stackoverflow.com
- How to change thin image to fat image in iPhone SDK?Best solution by Stack Overflow
- How to add image to QTextBrowser using Python?Best solution by Stack Overflow
- How to share native image and text on Facebook and Twitter?Best solution by Stack Overflow
- How to add text to jpeg image?Best solution by answers.microsoft.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.