

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 remove border in navigationBar in swift?
To remove the border from a navigation bar in swift, we just need to add a few lines of code. Let’s see how the navigation bar looks when we run it without changing anything.
Now let’s try to hide the line/ border shown in the above result.
The navigation bar has two things that give it the default view of a grey shadow along with bottom line as shown above. One is the background image, and the other is the shadow image.
First, we’ll hide the shadow image, by setting it to empty image and see how it looks.
In your viewDidLoad add the following code −
self.navigationController?.navigationBar.shadowImage = UIImage()
When we run the above code, we get the following result −
Now, we’ll also hide the background image just like shadow image, and it will look like the navigation bar has disappeared.
- Related Questions & Answers
- How to remove Specific Element from a Swift Array?
- How to remove border of bars from histogram in base R?
- How to use UICollectionView in Swift?
- How to remove the border from an editable element with CSS?
- Remove the right border from an element in Bootstrap
- How to use the front camera in Swift?
- How add 1 day to Date in swift?
- How to use MBProgressHUD with swift?
- Remove the top border from an element in Bootstrap 4
- Remove the left border from an element in Bootstrap 4
- How to set border width, border style, and border color in one declaration with JavaScript?
- How to send an attachment in email using Swift?
- How to integrate PayU Money in iOS using swift?
- How to Ping External host from Swift in iOS?
- Where and how to use static variable in swift?
Advertisements