0

Is it possible to change large navigation bar height?

self.navigationItem.largeTitleDisplayMode = .always 
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationController?.navigationBar.addSubview(expandedNavBar)
ChikabuZ
  • 10,031
  • 5
  • 63
  • 86

2 Answers2

1

I dont think you can change navigationBar height because of Apple HIG. If you want to change navigationBar height , you can remove navigationBar and you can show your own customview to user like navigationBar

If you want to make the navigationBar a little bigger, you can try this trick by adding an empty string to the prompt property.

self.navigationItem.prompt = ""
Omer Tekbiyik
  • 4,255
  • 1
  • 15
  • 27
0

Ok, I found this way:

let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.minimumLineHeight = 200
let attributes: [NSAttributedString.Key: Any] = [ .paragraphStyle: paragraphStyle]

let navigationBar = navigationController?.navigationBar
if #available(iOS 13, *) {
    if let appearance = navigationBar?.standardAppearance {
        appearance.largeTitleTextAttributes = attributes
        navigationBar?.standardAppearance = appearance
        navigationBar?.scrollEdgeAppearance = appearance
    }
} else {
    navigationBar?.largeTitleTextAttributes = attributes
}
ChikabuZ
  • 10,031
  • 5
  • 63
  • 86