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

180
Visualizações
How to properly animate SCNView height?

I'm trying to animate SCNView height, but it seems like there are some visual issue.

When content is growing it looks like everything is ok, but when I'm trying to decrease the height, view just jumps to final height instantly.

let newHeight = scene.frame.height + (open ? 100.0 : -100.0)
UIView.animate(withDuration: 1.0, animations: {
    self.scene.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: newHeight)
}) { finished in
    self.open = !self.open
}

See Code Running in Sumulator

With regular view everything works fine.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Set contentMode of SCNView to .scaleToFill where needed (e.g. in viewDidLoad). It works as expected.

let view: SCNView 
...
view.contentMode = .scaleToFill
over 4 years ago · Santiago Trujillo Relatório

0

There is a relationship between this behavior and the content mode of scene. You may try:

             scene.contentMode = .scaleToFill
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