Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autosizing UIImageView in code

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); ?

like image 570
daihovey Avatar asked Dec 10 '22 07:12

daihovey


1 Answers

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

self.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
like image 84
Deepak Danduprolu Avatar answered Dec 21 '22 22:12

Deepak Danduprolu