0

I am trying to create a photo application but I am having a tough time formatting my photos so that they show clearly.

I have an imageview size 320 * 500, and an image size 3648*2736 px (Which of course I can scale down).

 imageView.contentMode=UIViewContentModeScaleAspectFit;

With imageView.contentMode=UIViewContentModeScaleAspectFit; I changed the image size to 700* 525px (IMGA) and one 500 * 325(IMGB). In this mode

  • IMGA fills the entire image view but is somehow a little distorted/not crisp
  • IMGB does not fill the entire image view Top and Bottom but the width is perfect and the image is crisp.

UIViewContentModeScaleAspectFill With UIViewContentModeScaleAspectFill the image is made for fit into the uiimageview but again distorted even if the image is scaled down vs being scaled up.

I see many apps with crisp large images . and I am hoping that someone helps me with measuring/ contentmode to get my images better. Or correct my resizing

P.S I have been looking at this link to try help but I'm still missing my goal. Difference between UIViewContentModeScaleAspectFit and UIViewContentModeScaleToFill?

Community
  • 1
  • 1
Niana
  • 1,057
  • 2
  • 14
  • 42
  • "IMGB does not fill the entire image view Top and Bottom but the width is perfect and the image is crisp." - this seems like the expected behaviour for UIViewContentModeScaleAspectFit. the reason it does not 'fill the entire image view top and bottom' is because the image size (500 * 325) does not have the same aspect ratio as the imageview (500 *320). – codeinthesky Jul 24 '15 at 02:40
  • Also check how you are scaling your image: 3648*2736 is the same aspect ratio as 700 * 525, but it is not the same as 500 * 325 ( should be 500 * 375) – codeinthesky Jul 24 '15 at 02:47
  • @codeinthesky hi, I decided to use AspectFill. however, are you saying an image with measurements 3648*2736px can somehow fit in a uiimageview if I edit the aspect ratio? Not entirely sure that I noticed aspect ratio as a property of uiimageview – Niana Jul 26 '15 at 11:57

0 Answers0