0

i have uimage of screen size and in my application the image is coming from server so its size may be larger or smaller. so when i fit it into uimageimage its looking very bad. i have tried UIViewContentModeScaleAspectFit but the image is showing in rectangle shape. Is there any way to display my image in uimage properly without being stretch ?

aman
  • 15
  • 6
  • 1
    Are you sure the image is correct? Aspect fit doesn't stretch. – Wain Jul 27 '15 at 06:40
  • 1
    try using UIViewContentModeScaleAspectFill it will maintain aspect ratio,irrespective the image size – Mukesh Jul 27 '15 at 06:42
  • thank you munu but uiviewcontectscaleAspectFill is not working its showing opnly half of the image. – aman Jul 27 '15 at 10:19

1 Answers1

1

Try AspectFill, it could solve the problem.

Stefan
  • 1,283
  • 15
  • 33
  • As written here http://stackoverflow.com/questions/25478627/uiimage-resize-aspect-fill-and-crop [link](http://stackoverflow.com/questions/25478627/uiimage-resize-aspect-fill-and-crop) – Bhupendra Singh Jul 27 '15 at 08:21