"V:|[v(>=height)]-0.0@highPriority-|"
What will be the constraint (NSLayoutConstraint style) for above VFL.
Perhaps its considering view height with greaterThanEqual
& bottom constraint with UILayoutPriority.defaultHigh
.
Something i used -
let heightConstraint = NSLayoutConstraint(item: self.view!, attribute: NSLayoutAttribute.height, relatedBy: NSLayoutRelation.greaterThanOrEqual, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 0)
let bottomConstraint = NSLayoutConstraint(item: self.view!, attribute: NSLayoutAttribute.bottom, relatedBy: NSLayoutRelation.equal, toItem: nil, attribute: NSLayoutAttribute.notAnAttribute, multiplier: 1, constant: 0)
bottomConstraint.priority = .defaultHigh
NSLayoutConstraint.activate([heightConstraint,bottomConstraint])
Initial Set up for Answer:
For given VFL:
1. VFL Implementation:
2. NSLayoutConstraint Implementation:
The above VFL's
NSLayoutConstraint
equivalent is:NOTE: The given VFL in your question only provides the
childView
s y position and height.For width, add the constraints accordingly.
VFL Example for width would be:
Ref: