I have to set autoresizingMask programmatically for UIView.
I don't know how to implement this.
I have to set autoresizingMask programmatically for UIView.
I don't know how to implement this.
This is how you need to set it.
yourView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
To achieve what you have in that screen shot you need to do the opposite of what DrummerB suggests. You want a fixed top margin and right margin so you make every other side flexible like so:
view.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
view.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleBottomMargin;
If you want to know the concept very clearly,
UIView's autoresizing mask programmatically
View AutoResizingMask Constant
Autoresizing masks programmatically vs Interface Builder / xib / nib