skip to Main Content

Is it possible to change large navigation bar height?

self.navigationItem.largeTitleDisplayMode = .always 
self.navigationController?.navigationBar.prefersLargeTitles = true
self.navigationController?.navigationBar.addSubview(expandedNavBar)

2

Answers


  1. Chosen as BEST ANSWER

    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
    }
    

  2. 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 = ""
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search