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

296
Vistas
What is equivalent to center crop scale type of Android ImageView for iOS UIImageView?

I would like to ask how to scale an image to fill a UIImageView but still keep its aspect ratio, just like the centerCrop scale type of Android ImageView does.

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

You should use .scaleAspectFill. In swift 4.2:

myImageView.contentMode = .scaleAspectFill
myImageView.clipsToBounds = true // If you want to crop
over 4 years ago · Santiago Trujillo Denunciar

0

You can set image view contentMode to UIView.ContentMode.scaleAspectFill. It is equivalent of Android scaleType centerCrop

over 4 years ago · Santiago Trujillo Denunciar

0

Following are the main content modes of UIImageView:

  • UIViewContentModeScaleToFill
  • UIViewContentModeScaleAspectFit
  • UIViewContentModeScaleAspectFill

the one to fill the whole imageview is 'ScaleAspectFill' plus you can also use 'clipsToBound' property as true so that it will crop the extra image which is out of imageview.

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