Mundi
Mundi

Reputation: 80271

Why is this autolayout specification not sufficient?

I am trying to get rid of those annoying warnings in Interface Builder, but I do not understand what it is complaining about (all Interface Builder, no code):

Sceenshot from Xcode - Interface Builder

I have specified a fixed with, fixed height and fixed distances to right and top.

Yet the warning tells me

Needs Constraints for: Y position, height
Needs Constraints for: X position, width

Can someone please explain how these are constraints are not sufficient?

Edit
Also, when using the "automatic" add constraints commands, it does nothing and the errors remain.

Upvotes: 6

Views: 2458

Answers (1)

user189804
user189804

Reputation:

I would suspect the superview is not pinned to a size in interface builder. Autolayout constraints seem to solve everything simultaneously and an error message that looks like it relates to one view can just as easily relate to the other view in the relationship.

What is - (NSArray *)constraintsAffectingLayoutForAxis:(UILayoutConstraintAxis)axis telling you?

Upvotes: 1

Related Questions