Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 376
Mundi Avatar asked Aug 26 '13 22:08

Mundi


1 Answers

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?

like image 103
Adam Eberbach Avatar answered Oct 27 '22 17:10

Adam Eberbach