- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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
Advertisements