Masonry Help


I am new to the autolayout and constraints in iOS. I want to make a image view fill up the parent view. I am using Masonry.

I have tried various forms of the following code. So far I have only been able to make the top and left pin to 0,0.

imgViewBackground.MakeConstraints (make => {
make.Top.And.Left.EqualTo (superview); // chain .Top and .Left
make.Height.And.Width.EqualTo (superview);

I have also tried;

imgViewBackground.MakeConstraints (make => {

Does anyone have any suggestions on how to constrain a view to the size of its parent in code? Thank you in advance.

Best Answer


Sign In or Register to comment.