
- 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 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 Articles
- How to remove border of bars from histogram in base R?
- How to remove all subviews of a view in Swift?
- How can I make a button have a rounded border in Swift?
- How to remove Specific Element from a Swift Array?
- How to remove the border from an editable element with CSS?
- Remove the right border from an element in Bootstrap
- Array extension to remove an object by value in Swift
- Remove border from IFrame using CSS
- Remove the top border from an element in Bootstrap 4
- Remove the left border from an element in Bootstrap 4
- How to remove the border of the legend of a chart created by plot function in R?
- How to set border width, border style, and border color in one declaration with JavaScript?
- Remove white border when using subplot and imshow in Python Matplotlib
- Swift Program to Remove All Occurrences of an Element in an Array
- How should I remove all the leading spaces from a string in Swift?

Advertisements