Manish Jain Manish Jain - 2 months ago 9
iOS Question

uiimageview aspectfill issue

I have layout with multiple imageviews, which look perfect with Mode->Aspect Fill as below.

enter image description here

now my situation is when I run the same, the whole layout just break into peaces.

enter image description here

Answer

For each of your UIImageView make sure to enable clipSubviews in Interface Builder.

Clip Subviews

What happens is that your views are positioned and sized properly, but since the contained image is bigger than the containing view it will bleed out outside of the view boundaries.