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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:52:13+00:00 2026-05-20T14:52:13+00:00

Is it possible to have an invisible navigation bar background? I’ve seen custom ones

  • 0

Is it possible to have an invisible navigation bar background? I’ve seen custom ones before, but would love some guidance on how to do this.

Thanks in advance!

  • 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-20T14:52:14+00:00Added an answer on May 20, 2026 at 2:52 pm

    To get a transparent background on a UINavigationBar or UIToolbar, you have to set the background color to [UIColor clearColor], set opaque to NO (if it isn’t already), and override drawRect to not draw the standard gradient background. The third is the tricky part.

    If you’re using UINavigationBar directly, you can easily enough just subclass it to override drawRect. But I see you tagged this with UINavigationController, so you’ll have to try overriding it with a category. Something like this should do it:

    @implementation UINavigationBar (invisibleBackground)
    
    - (void)drawRect:(CGRect)rect {}
    
    @end
    

    That has the drawback that every navbar in your app will now have no background. If you want to be able to have some transparent and some normal, you have to go one step further and swizzle drawRect so you can call the original when needed:

    #import <objc/runtime.h>
    
    @implementation UINavigationBar (invisibleBackgroundSwizzle)
    
    // The implementation of this method will be used to replace the stock "drawRect:". The old
    // implementation of "drawRect:" will be attached to this name so we can call it when needed.
    - (void)replacementDrawRect:(CGRect)rect {
        if (![self.backgroundColor isEqual:[UIColor clearColor]]) {
            // Non-transparent background, call the original method (which now exists
            // under the name "replacementDrawRect:"). Yes, it's a bit confusing.
            [self replacementDrawRect:rect];
        } else {
            // Transparent background, do nothing
        }
    }
    
    // This special method is called by the runtime when this category is first loaded.
    + (void)load {
        // This code takes the "drawRect:" and "replacementDrawRect:" methods and switches
        // thier implementations, so the name "drawRect" will now refer to the method declared as
        // "replacementDrawRect:" above and the name "replacementDrawRect:" will now refer
        // to the original implementation of "drawRect:".
        Method originalMethod = class_getInstanceMethod(self, @selector(drawRect:));
        Method overrideMethod = class_getInstanceMethod(self, @selector(replacementDrawRect:));
        if (class_addMethod(self, @selector(drawRect:), method_getImplementation(overrideMethod), method_getTypeEncoding(overrideMethod))) {
            class_replaceMethod(self, @selector(replacementDrawRect:), method_getImplementation(originalMethod), method_getTypeEncoding(originalMethod));
        } else {
            method_exchangeImplementations(originalMethod, overrideMethod);
        }
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In an HTML-document, i want to have a (if possible: invisible) form that POSTs
I have an application which uses a custom title bar. However, when my application
I would like to know if it's possible to make pages invisible for users
I have a zooming UIScrollView that contains a UIView which contains some custom UIViews
I have a navigation-based application where it is possible for the user to hide
I'm wondering if it is possible to have unique characters that cannot be seen
Is it possible have two projects with the same name in flex builder? Here
is possible to have a separator between elements of a GridView? Thanks
Is it possible to have a MySQLi prepared statement within the fetch() call of
Is it possible to have XML-embedded JavaScript executed to assist in client-side (browser-based) XSL

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.