Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var dict = ["txtHome" : txtHome]
- self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-[txtHome]-|", options: nil, metrics: nil, views: dict))
- self.view.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-(>=90,<=100)-[txtHome(20)]-|", options: nil, metrics: nil, views: dict))
- Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
- (
- "<NSLayoutConstraint:0x7966d210 V:|-(<=100)-[UITextField:0x79666440] (Names: '|':UIView:0x796637d0 )>",
- "<NSLayoutConstraint:0x7966d280 V:[UITextField:0x79666440(20)]>",
- "<NSLayoutConstraint:0x7966d240 UIView:0x796637d0.bottomMargin == UITextField:0x79666440.bottom>",
- "<NSLayoutConstraint:0x7966e880 'UIView-Encapsulated-Layout-Height' V:[UIView:0x796637d0(480)]>"
- )
- Will attempt to recover by breaking constraint
- <NSLayoutConstraint:0x7966d240 UIView:0x796637d0.bottomMargin == UITextField:0x79666440.bottom>
- Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
- The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement