Programmatically, and not with using xib files? UIView's autoresizingMask is not really the right thing, I think. Since it's not about resizing but laying out. I couldn't find layout masks. But Interface Builder seems to allow to attach a view to top, left, right, center or bottom. So there must be a mechanism.
https://developer.apple.com/documentation/uikit/uiview/1622559-autoresizingmask
[view setAutoresizingMask: UIViewAutoresizingFlexibleTopMargin];
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.