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 8820683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:40:08+00:00 2026-06-14T05:40:08+00:00

Is there a way to customize ALL uibarbuttonitems to have a background image without

  • 0

Is there a way to customize ALL uibarbuttonitems to have a background image without using UIApperance? Unfortunately our codebase has some limitations and we’re not able to use UIAppearance so I’m looking for an alternative.

Thanks in advance.

Edit: I was able to do this by subclassing UIBarButtonItem and it works for most of my buttons…but I’m wondering specifically how to do it with default buttons like UITableView edit buttons and UINavigationController backbuttons.

Thanks!

  • 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-06-14T05:40:09+00:00Added an answer on June 14, 2026 at 5:40 am

    You also can make subclass like this. First i go to make subclass of UIBarButtonItem. My CustomBarButtonItem.h should be like this.

    @interface CustomBarButtonItem : UIBarButtonItem
    
    + (CustomBarButtonItem *)sharedInstance;
    - (UIBarButtonItem *)backButtonwithTarget:(id)target andAction:(SEL)action;
    
    
    @end
    

    then inside my CustomBarButtonItem.m should like this.

    @implementation CustomBarButtonItem
    
    static CustomBarButtonItem * _sharedInstance = nil;
    
    + (CustomBarButtonItem *)sharedInstance
    {
        if (_sharedInstance != nil)
        {
            return _sharedInstance;
        }
        _sharedInstance = [[CustomBarButtonItem alloc] init];
    
        return _sharedInstance;
    }
    
    - (UIBarButtonItem *)backButtonwithTarget:(id)target andAction:(SEL)action
    {
        UIImage *backImage = [UIImage imageNamed:@"back_btn_normal.png"];
        UIImage *backPressed = [UIImage imageNamed:@"back_btn_hilight.png"];
        UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
        [backButton addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
        [backButton setBackgroundImage:backImage forState:UIControlStateNormal];
        [backButton setBackgroundImage:backPressed forState:UIControlStateHighlighted];
    
        const CGFloat BarButtonOffset = 5.0f;
        [backButton setFrame:CGRectMake(BarButtonOffset, 0, backImage.size.width, backImage.size.height)];
    
        UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, backImage.size.width, backImage.size.height)];
        [containerView addSubview:backButton];
    
        UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithCustomView:containerView];
        return item;
    }
    @end
    

    Then where ever you want to make custom NavigationItem (Button in the NavigationBar) you can put the code below for me it custom.

    - (void)viewDidLoad
    {
        self.navigationItem.leftBarButtonItem = [[CustomBarButtonItem sharedInstance] backButtonwithTarget:self andAction:@selector(searchButtonTapped:)];
    }
    

    All of my code are working fine. Hopefully it will help you.

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

Sidebar

Related Questions

is there a simple way (Delegation? Overwriting?) do globally customize all the back buttons
is there a simple way (Delegation? Overwriting? Category?) do globally customize all the back
Is there a way to customize the SBCL REPL in a way that makes
Is there a way to customize a favorite or bookmark icon for Android? I
What is the way (if there is a way) to customize the menu (the
Is there way to copy a file into Plone with WebDAV and have Plone
Hi is there any way to customize SharePoint 2010 rich text editor toolbar? I
Is there any way to customize or control which type of collection class types
There has been some discussion of the merits or demerits / evilness of using
Is there a simple way to modify/customize error messages generated by Symfony validators? eg.

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.