transparent navigation bar ios

ios navigation bar transparent background
ios 11 transparent navigation bar
transparent navigation bar ios 13
ios transparent status bar
navigation bar height ios 13
common navigation bar ios swift
custom navigation bar swift
uiimagepickercontroller navigation bar color ios 13

I'm creating an app and i've browsed on the internet and i'm wondering how they make this transparent navigationBar like this:

I've added following like in my appdelegate:

UINavigationBar.appearance().translucent = true

but this just makes it look like following:

How can i make the navigationBar transparent like first image

You can apply Navigation Bar Image like below for Translucent.

Objective-C:

[self.navigationController.navigationBar setBackgroundImage:[UIImage new]
                     forBarMetrics:UIBarMetricsDefault]; //UIImageNamed:@"transparent.png"
self.navigationController.navigationBar.shadowImage = [UIImage new];////UIImageNamed:@"transparent.png"
self.navigationController.navigationBar.translucent = YES;
self.navigationController.view.backgroundColor = [UIColor clearColor];

Swift 3:

self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) //UIImage.init(named: "transparent.png")
self.navigationController?.navigationBar.shadowImage = UIImage()
self.navigationController?.navigationBar.isTranslucent = true
self.navigationController?.view.backgroundColor = .clear

Hope it helps you..!

How to create transparent Status Bar and Navigation Bar in iOS?, You might have come across many application where the screen extends to complete screen i.e transparent Status Bar and transparent  iOS Apps/Applications Mobile Development You might have come across many application where the screen extends to complete screen i.e transparent Status Bar and transparent navigation bar. Here we will be seeing how to create an application where the you’ll be having transparent status and navigation bar. So let’s get started

Swift Solution

This is the best way that I've found. You can just paste it into your appDelegate's didFinishLaunchingWithOptions method:

Swift 3 / 4

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    // Sets background to a blank/empty image
    UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
    // Sets shadow (line below the bar) to a blank image
    UINavigationBar.appearance().shadowImage = UIImage()
    // Sets the translucent background color
    UINavigationBar.appearance().backgroundColor = .clear
    // Set translucent. (Default value is already true, so this can be removed if desired.)
    UINavigationBar.appearance().isTranslucent = true
    return true
}

Swift 2.0

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.
    // Sets background to a blank/empty image
    UINavigationBar.appearance().setBackgroundImage(UIImage(), forBarMetrics: .Default)
    // Sets shadow (line below the bar) to a blank image
    UINavigationBar.appearance().shadowImage = UIImage()
    // Sets the translucent background color
    UINavigationBar.appearance().backgroundColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.0)
    // Set translucent. (Default value is already true, so this can be removed if desired.)
    UINavigationBar.appearance().translucent = true

    return true
}

source: Make navigation bar transparent regarding below image in iOS 8.1

Transparent Navigation Bar iOS, A Boolean value indicating whether the navigation bar is translucent ( YES ) or not ( NO ). SDKs. iOS 3.0+; Mac Catalyst 13.0+; tvOS 9.0+. Framework. UIKit. Use a navigation bar in your app, which automatically displays a status bar background and ensures that content doesn’t appear under the status bar. Display a custom image, like a gradient or solid color, behind the status bar. Place a blurred view behind the status bar. For developer guidance, see UIBlurEffect.

Swift 5 applying only to the current view controller

override func viewWillAppear(_ animated: Bool) {
    super.viewWillAppear(animated)

    // Make the navigation bar background clear
    navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default)
    navigationController?.navigationBar.shadowImage = UIImage()
    navigationController?.navigationBar.isTranslucent = true
}

override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)

    // Restore the navigation bar to default
    navigationController?.navigationBar.setBackgroundImage(nil, for: .default)
    navigationController?.navigationBar.shadowImage = nil
}

transparent navigation bar ios - Mr.Javed Multani, Tutorial – Transparent UI Navigation Bar. Feb 21, 2016 | Posted by Andrew | ios, swift, tutorial, xcode |. Making the UINavigation bar transparent & see through is  Change the status bar style via : In your Info.plist you need to define View controller-based status bar appearance to any value. UIApplication.shared.statusBarStyle = .lightContent If you want to hide the status bar: UIApplication.shared.isStatusBarHidden = true Getting this output by light content and by transparent navigation.

Swift 3 : extension for Transparent Navigation Bar

extension UINavigationBar {
    func transparentNavigationBar() {
    self.setBackgroundImage(UIImage(), for: .default)
    self.shadowImage = UIImage()
    self.isTranslucent = true
    }
}

translucent, Nothing changes much in a plain style table view, the navigation bar will Your UI for iOS 13, this one will be used when navigation associated with a on whether you want your bar to be translucent, opaque, or transparent. This iOS platform-specific is used to change the transparency of the navigation bar on a NavigationPage, and is consumed in XAML by setting the NavigationPage.IsNavigationBarTranslucent attached property to a boolean value:

Swift 4.2 Solution: For transparent Background:

  1. For General Approach:

    override func viewDidLoad() {
        super.viewDidLoad()
    
        self.navigationController?.navigationBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
        self.navigationController?.navigationBar.shadowImage = UIImage()
        self.navigationController?.navigationBar.isTranslucent = true
    
    }
    
  2. For Specific Object:

    override func viewDidLoad() {
        super.viewDidLoad()
    
        navBar.setBackgroundImage(UIImage(), for: UIBarMetrics.default)
        navBar.shadowImage = UIImage()
        navBar.navigationBar.isTranslucent = true
    
    }
    

Hope it's useful.

Tutorial - Transparent UI Navigation Bar, A UIViewController category that can make the navigation bar transparent set your UINavigationBar background to transparent or to any UIColor you choose. When the navigation bar is translucent, configure the edges For Extended Layout and extended Layout Includes Opaque Bars properties of your view controller to display your content underneath the navigation bar.

UINavigationBar changes in iOS13, func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {. // Override  Typically, translucent UINavigationBar s have a light gray color above a white background. However, many navigation bars throughout iOS 11 have a white color. For example, navigation bars in the Files app are white AND translucent which are noticeably different from setting barTintColor to white.

IdleHandsApps/UINavigationBar-Transparent: A , Put this code into viewDidLoad method of a view controller where you want to have transparent navigation bar. Swift 3.0. Swift. 1-Create a class that extends from NavigationPage 2-We use an iOS platform specific to specify bar is translucent. Make sure to set the color BackgroundColor to Transparent and set the property  NavigationPage.IsNavigationBarTranslucent= “ True ” on iOS. 2-Create a custom renderer for iOS

Transparent navigation bar ios · GitHub, In this short video, i will show you guys how to set the navigation bar to transparent in Xcode using Swift 4. Currently there is not way to set the navigation bar to transparent using storyboard.

Comments
  • With the code I don't know, but if you're good with CSS, you can use a framework (Pixate : freestyle.org), and could just apply a CSS style to your navbar :) !
  • when i setBackgroundImage it removes the barTintColor?
  • You can get image of Navigation bar..As per your need..and apply to navigation bar as above..(Image you want to apply to navigation bar)
  • does this code really works?I want the same kind of navigation bar in my app.How did you do that?
  • setting the backgroundColor of the navigationController isn't necessary
  • With this solution I get a black navigationBar, any ideas ?
  • Your Swift 3 solution just makes my bar plain white.
  • @JozemiteApps try making a brand new Xcode project and paste the code in. Should only take 3 minutes to confirm if it's my code above or something about your project that's causing this.
  • I also got a plain white navibar and no transparent navibar
  • This works great, thank you! Do you know how you could implement it such that the only the navigation bars on desired ViewControllers are transparent?