ios - Constraints aren't being added through updateViewConstraints -
i making custom keyboard , have function named setbuttonconstraints(). when insert function viewdidload() , run app constraints set. when move function call override func updateviewconstraints() (which supposed called after subviews have been layed out) no constraints set. cause of this?
this simple updateviewconstraints() looks like:
override func updateviewconstraints() { super.updateviewconstraints() // add custom view sizing constraints here setbuttonconstraints() }
per apple's documentation, updateviewconstraints()
gets called if constraints need updated. also, believe need call super.updateviewconstraints()
after change constraints.
the following link helpful.
where should setting autolayout constraints when creating views programmatically
Comments
Post a Comment