
- 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 get the Navigation Bar height in iOS?
A navigation bar appears at the top of an app screen. To read more about it
https://developer.apple.com/design
https://developer.apple.com/documentation
Getting height of Navigation bar becomes important if you’ve multiple view controllers having different UI and requirement. It becomes hectic if you’re not aware how to get the height of the same or modify as per need. Let’s see how we can get the height of Navigation bar.
import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() let navBarHeight = UIApplication.shared.statusBarFrame.size.height + (navigationController?.navigationBar.frame.height ?? 0.0) print(navBarHeight) } }
- Related Articles
- How to create transparent Status Bar and Navigation Bar in iOS?
- How to set background for Navigation Bar in iOS?
- Adding Navigation Bar programmatically iOS using Swift
- How do I get the height and width of the Android Navigation Bar programmatically?
- How can I change the text color of the Navigation Bar on iOS?
- How do I get the height and width of the Android Navigation Bar programmatically using Kotlin?
- How to get the Action bar height in android?
- How to create a navigation bar with equal-width navigation links with CSS?
- How to permanently hide Navigation Bar in an Android Activity?
- How to create a dropdown navigation bar with CSS?
- How to add link dividers in a Navigation Bar with CSS
- How to create a responsive navigation bar with dropdown in CSS?
- How to permanently hide the Navigation Bar in an Android activity using Kotlin?
- How to create Tab Bar Layout in an iOS App?
- How to hide the status bar in a iOS App using Swift?

Advertisements