The presence of the I-beam on the left, right, and bottom means that they're fixed (i.e. not flexible), so you should not use UIViewAutoresizingFlexibleLeftMargin
, UIViewAutoresizingFlexibleRightMargin
, or UIViewAutoresizingFlexibleBottomMargin
. The absence of the top I-beam means that you should employ UIViewAutoresizingFlexibleTopMargin
.
The presence of the width arrow means that the width is flexible, and that you should therefore include UIViewAutoresizingFlexibleWidth
. But the absence of the height arrow means that UIViewAutoresizingFlexibleHeight
should not be used.
Thus, that yields:
self.imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;
By the way, you can verify this empirically. Temporarily add a view in Interface Builder using the combinations of springs and struts that you shared with us:

Then you can use a routine like the following to examine the auto resizing mask of that view:
- (void)examineAutosizingMask:(UIView *)view
{
NSDictionary *masks = @{@"UIViewAutoresizingFlexibleBottomMargin" : @(UIViewAutoresizingFlexibleBottomMargin),
@"UIViewAutoresizingFlexibleHeight" : @(UIViewAutoresizingFlexibleHeight),
@"UIViewAutoresizingFlexibleLeftMargin" : @(UIViewAutoresizingFlexibleLeftMargin),
@"UIViewAutoresizingFlexibleRightMargin" : @(UIViewAutoresizingFlexibleRightMargin),
@"UIViewAutoresizingFlexibleTopMargin" : @(UIViewAutoresizingFlexibleTopMargin),
@"UIViewAutoresizingFlexibleWidth" : @(UIViewAutoresizingFlexibleWidth) };
for (NSString *key in masks) {
if (view.autoresizingMask & [masks[key] longValue]) {
NSLog(@"%@", key);
}
}
}
The above routine will confirm you that you want UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth
.
You can also confirm this in the debugger, as it provides a good tool to examine the configuration of views (their frames and autosizing masks). Run the app in the debugger, and once the view has been presented, hit the pause button. Then, at the (lldb)
prompt, type:
(lldb) po [[UIWindow keyWindow] recursiveDescription]
That will generate output like so:
<UIWindow: 0x8c61080; frame = (0 0; 320 480); gestureRecognizers = <NSArray: 0x8c60070>; layer = <UIWindowLayer: 0x8c609b0>>
| <UIView: 0x8c614d0; frame = (0 0; 320 480); autoresize = RM+BM; layer = <CALayer: 0x8c615b0>>
| | <UIImageView: 0x8d212a0; frame = (80 159; 160 263); autoresize = W+TM; userInteractionEnabled = NO; layer = <CALayer: 0x8d213a0>>
As you can see, this is also reporting that the width and top margin autosizing masks have been used (where it says W+TM
). This output can also be useful for diagnosing the frame size.
By the way, in addition to setting the auto sizing bit mask as discussed, you may want to confirm the content mode and the clipping setting. Notably, you may also want to make sure you clip the image view to its bounds (or else the image may overflow the bounds, misleading you on the actual size of the frame):
self.imageView.clipsToBounds = YES;