Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

228
Visualizações
Increase the height of UINavigationBarLargeTitleView

I want to add a banner to the navigation bar, but by increasing the height of it. I want to copy the design and behaviour of an artist page in the Apple Music app:

Apple Music

It behaves just like a normal Large Title would, except for that it has been moved down, it has a sticky UIImageView behind it and it returns its background when the user scrolls down far enough. You can fire up Apple Music, search for an artist and go to their page to try it out yourself.

I've tried a bunch of things like setting the frame on the UINavigationBarLargeTitleView, and the code from this answer: https://stackoverflow.com/a/49326161/5544222

I already got a hold of the UINavigationBarLargeTitleView and its UILabel using the following code:

func setLargeTitleHeight() {
    if let largeTitleView = self.getLargeTitleView() {
        if let largeTitleLabel = self.getLargeTitleLabel(largeTitleView: largeTitleView) {
            // Set largeTitleView height.
        }
    }
}

func getLargeTitleView() -> UIView? {
    for subview in self.navigationBar.subviews {
        if NSStringFromClass(subview.classForCoder).contains("UINavigationBarLargeTitleView") {
            return subview
        }
    }
    return nil
}

func getLargeTitleLabel(largeTitleView: UIView) -> UILabel? {
    for subview in largeTitleView.subviews {
        if subview.isMember(of: UILabel.self) {
            return (subview as! UILabel)
        }
    }
    return nil
}
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Initially put a view with image and label and play button. Then clear the navigation bar it will show the image below it by

self.navigationController!.navigationBar.setBackgroundImage(UIImage(), for: .default)
    self.navigationController!.navigationBar.shadowImage = UIImage()
    self.navigationController!.navigationBar.isTranslucent = true

later when you scroll up you have to handle it manually and again show the navigation with title.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda