I want to align red image at bottom of scrollview. In portrait orientation it looks fine as the height of scrollview is equal to view height.
But in landscape mode it looks like this, when in landscape I want it to be completely hidden until the user scroll till the bottom of scrollview, so that the red image is always at the bottom of scroll view. Currently it looks like this in landscape mode.

I have added red image as a subview of scrollview and applied bottommarginautoresizingmask to it.

If you are using
autoresizingthen you need to setleft,right,bottomandflexibleWidthmasks to bothUIImageViewandUIScrollView. Take a look at the images attached here.If your
UIScrollViewcovers the whole screen then set all the resizing masks foritbut forUIImageViewset only the ones stated above.Hope it helps.
Output in simulator: