Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

299
Views
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 answers
Answer question

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 Report

0

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

over 4 years ago · Santiago Trujillo Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!