0

I am trying to create a news feed with a title, description and image. I am using auto layout and I can't correctly auto resize my image (i.e. width, that fills all screen and resizable height, that keeps ratio of original image).

I found a solution using "Aspect fit" mode for image view, but a big blank space is a real problem sometimes:

I searched everywhere, and didn't find a solution to this problem.

Another option is tp use "Aspect fill" mode, but it doesn't show the whole picture:

I can't believe it is impossible to resize an image and show it on screen with specific constraints, without blank spaces.

Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
  • You want to use "Aspect Fit" mode, but you need to dynamically adjust the height of your image view to avoid the spacing. Your image view will be as tall as you tell it to be. – Aaron Brager Jun 08 '15 at 14:27
  • This could help you: http://stackoverflow.com/questions/12711133/how-to-set-image-in-top-avoiding-space-in-uiimageview – Erakk Jun 08 '15 at 14:38
  • I think your problem was resolved here [http://stackoverflow.com/questions/26041820/auto-layout-get-uiimageview-height-to-calculate-cell-height-correctly][1] [1]: http://stackoverflow.com/questions/26041820/auto-layout-get-uiimageview-height-to-calculate-cell-height-correctly – Mazel Tov Jun 08 '15 at 14:44

1 Answers1

0

I guess you may want to re-align both the text and the Image View so that the Guidelines just fit below the Navigation Bar.

Try ctrl+ Click and drag and drop over the text. I don't have a clear idea to guide you. But I guess this should work.

Gee Kay
  • 31
  • 4