Bernd Rabe
Bernd Rabe

Reputation: 790

Autolayout with overlapping views

I've two views (Text/Image) where one covers the total width of the screen, the other one is an image which sits in lower right corner of the text view. Up to now I was not able write layout constraints to have both view right and bottom aligned to each other. Here is what I tried to accomplish it but the statusA1 is incorrect.

NSArray *horizontalA = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[answerA]|" options:0 metrics:nil views:viewsDict];

NSArray *statusA1 = [NSLayoutConstraint constraintsWithVisualFormat:@"[answerA][statusA]" options:NSLayoutFormatAlignAllBottom | NSLayoutFormatAlignAllRight metrics:0 views:viewsDict];

Upvotes: 0

Views: 2511

Answers (1)

Divyam shukla
Divyam shukla

Reputation: 2048

Set the vertical spacing between two and remove the bottom contraints on both the subviews.

Upvotes: 3

Related Questions