简体   繁体   中英

iOS - Image retina is fuzzy

I'm having problem displaying my imageView in a correct manner. I'm a beginner in auto layout and size classes. This is what I'm doing in the .xib:

I have a UIImageView :

  • original size: 709 x 485
  • size in xib: 363 x 248
  • I add the following constraints to the image:

    • Equal Width to superview with constant = -57 (I changed it to -57 because constant = 0 is too big in 3.5" and 4") and multiplier = 0.7
    • Aspect ratio to itself (121:82)
  • And other top bottom, align x constraints

now my problem is that when I added the @2x and @3x images to my project the image is fuzzy and not sharp on retina screens.

Is it the constraint equal width and aspect ratio affecting the image and not scaling properly to fit all sizes?

What should I do in this case?

The reason that the large images look fuzzy on retina screens could be because of Aliasing. So you need to anti-alias the images.

Have a look at the following link: Anti Alias, UIImage and Performance

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM