Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3616764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:32:21+00:00 2026-05-18T22:32:21+00:00

(edited: added more information at bottom) Firstly I have looked through similar posts and

  • 0

(edited: added more information at bottom)

Firstly I have looked through similar posts and tried their answers but with no luck 🙁 I have a custom navigation bar (just a custom background image) and I’m trying to add a custom back button.

// custom back button.
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *backImg = [UIImage imageNamed:@"btn_back.png"];
backBtn.titleLabel.text = @"";
[backBtn setBackgroundImage:backImg forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(backPressed) forControlEvents:UIControlEventTouchUpInside];
backBtn.frame = CGRectMake(0, 0, 54, 33);

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem.title = @"";

The above code is meant to add the button but it does not display on the nav bar. I can still click the area where its meant to appear and it does bring me back to the previous view?! removing the above code displays the standard back button.

Any ideas? Thanks in advance!

(edit)

Hi again guys,

I tried all your suggestions and still no luck 🙁 I probably should have mentioned earlier that I have a custom nav bar image using the following code. This might be affecting the display of my custom back button image.

This code displays a custom image depending upon a parameter I set. Thanks again for further help!

// custom navigation bar image
@implementation UINavigationController (CustomImage)

// set the background image for the nav bar.
- (void) setCustomNavBar:(NSInteger)screen {

UIImage *navBarImg;
switch (screen) {
    case kCreateHuntScreenIdentifier:
        navBarImg = [UIImage imageNamed:@"title_create-hunt.png"];
        break;

    case kCreateLocationsScreenIdentifier:
        navBarImg = [UIImage imageNamed:@"title_create-location.png"];
        break;

    case kListNewLocationsScreenIdentifier:
        navBarImg = [UIImage imageNamed:@"title_choose-location.png"];
        break;

    default:
        break;
}

UIImageView *imgView = [[UIImageView alloc] initWithImage:navBarImg];
[[[self.navigationBar subviews] objectAtIndex:0] removeFromSuperview];
[self.navigationBar addSubview:imgView];
[imgView release];
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:32:21+00:00Added an answer on May 18, 2026 at 10:32 pm

    Thanks again for all your advice! I finally found a solution 😀

    Very quickly I needed to be able to change the background image for a navigation bar from view to view when I pushed or popped the stack.

    Using the most popular methods such as overriding the UINavigationBar’s drawRect would only partly work, it would work on the root view but then push the image to the front of the navigation bar’s stack for every other screen no matter if I sent it to the back, etc.

    I found the solution here: http://sebastiancelis.com/2009/12/21/adding-background-image-uinavigationbar/

    Take a read, it works great 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I edited epoc.ini added textshell in the first line. When I run from the
Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
--edited for clarity (hopefully) I have an XML file that looks something like this:
I have an app that I made with wxglade. I've added a mediacontrol to
I have a system set up for users to submit their articles into my
Update to prevent any more wrong answers: A product has many product images There
Edit 4/4/12 I STILL HAVE ONE QUESTION: I solved my issue but it adds
// edited by Neil Butterworth to conserve vertical space #include <stdio.h> struct A; struct
Edited Question: This should be clear. using System; namespace UpdateDateTimeFields { class Program {
(Edited a lot) I've got some classes with Abstracts Members. The concrete type of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.