Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda