
- iOS Tutorial
- iOS - Home
- iOS - Getting Started
- iOS - Environment Setup
- iOS - Objective-C Basics
- iOS - First iPhone Application
- iOS - Actions and Outlets
- iOS - Delegates
- iOS - UI Elements
- iOS - Accelerometer
- iOS - Universal Applications
- iOS - Camera Management
- iOS - Location Handling
- iOS - SQLite Database
- iOS - Sending Email
- iOS - Audio & Video
- iOS - File Handling
- iOS - Accessing Maps
- iOS - In-App Purchase
- iOS - iAd Integration
- iOS - GameKit
- iOS - Storyboards
- iOS - Auto Layouts
- iOS - Twitter & Facebook
- iOS - Memory Management
- iOS - Application Debugging
- iOS Useful Resources
- iOS - Quick Guide
- iOS - Useful Resources
- iOS - Discussion
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 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
Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “TransparentViews”
Step 2 − Embed the View Controller in Navigation Controller. Add Image View and shown and add image.
Step 3 − Run the application without adding any piece of code for making status and navigation bar transparent.
The screen looks like below
Step 4 − Now Open ViewController.swift and add following code in viewDidLoad method.
override func viewDidLoad(){ super.viewDidLoad() self.navigationController!.navigationBar.setBackgroundImage(UIImage(), for: .default) self.navigationController!.navigationBar.shadowImage = UIImage() self.navigationController!.navigationBar.isTranslucent = true }
Step 5 − Run the application
- Related Articles
- How to set background for Navigation Bar in iOS?
- How to get the Navigation Bar height in iOS?
- Adding Navigation Bar programmatically iOS using Swift
- How to check which notifications are active in status bar in iOS?
- How to hide the status bar in a iOS App using Swift?
- Create circular Progress Bar in iOS
- How to create a dropdown navigation bar with CSS?
- How to create transparent bar plot using ggplot2 in R?
- How to create a navigation bar with equal-width navigation links with CSS?
- Create a Horizontal Navigation Bar with CSS
- How to create Tab Bar Layout in an iOS App?
- How to create a responsive navigation bar with dropdown in CSS?
- How to hide status bar in Android?
- How to Create an On Scroll Fixed Navigation Bar with CSS?
- How can I change the text color of the Navigation Bar on iOS?

Advertisements