How to add image to navigation back button
-
I have a backbutton image (backButton). How can I add it to the back button of the navigation bar? UIBarButtonItem *newBackButton = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"backButton"] style:UIBarButtonItemStylePlain target:nil action:nil]; viewController.navigationItem.backBarButtonItem = newBackButton; [newBackButton release]; However, I am getting a weird looking button as seen below. How can I replace the backbutton with the full black back button image?
-
Answer:
You'll have to modify the black image's pixel size. Open up the image in any image editor, go to the adjust image size (it may be called something else in a different photo editor) find out the size and pixels. It looks like you'll have to make the thing 1 pixel taller and like 2 pixels wider, but I'm not sure. You can probably find some documentation on the exactly pixel size of the navigation button and work with that. Goodluck
Zhen at Stack Overflow Visit the source
Related Q & A:
- How to add image to QTextBrowser using Python?Best solution by Stack Overflow
- How to Add Image and text at the Top of Fly Out Navigation?Best solution by Stack Overflow
- How to use an image as an INVISIBLE button in Ionic?Best solution by Stack Overflow
- How to detect only if back button is pressed?Best solution by Stack Overflow
- How to add a button in a Fragment?Best solution by Stack Overflow
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.