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
autoresizing
then you need to setleft
,right
,bottom
andflexibleWidth
masks to bothUIImageView
andUIScrollView
. Take a look at the images attached here.If your
UIScrollView
covers the whole screen then set all the resizing masks forit
but forUIImageView
set only the ones stated above.Hope it helps.
Output in simulator: