4

autosizing

I am moving a custom UITableViewCell from Interface Builder and into code, but I'm unsure of how to copy the autosizing in the image above.

Would it be self.autoresizingMask = (UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin); ?

daihovey
  • 3,385
  • 13
  • 63
  • 106
  • 1
    The given link might help: http://stackoverflow.com/questions/7754851/autoresizing-masks-programmatically-vs-interfact-builder-xib-nib – Ambili B Menon Oct 10 '12 at 07:08

1 Answers1

14

No. The autosizing clamps to the edges and has flexible height and width so it should be,

self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
Deepak Danduprolu
  • 44,474
  • 11
  • 99
  • 105