Autosizing UIImageView in code
I am moving a custom UITableViewCell from Int开发者_StackOverflow中文版erface 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);
?
No. The autosizing clamps to the edges and has flexible height and width so it should be,
self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
精彩评论