Search code examples
iosautolayoutstoryboarduistoryboardnslayoutconstraint

Storyboard: align button in custom UIView to another button in parent UIView using auto-layout constraints?


Assume a custom UIView, CustomView, that is designed with a Xib file. Inside CustomView is a UIButton, CustomButton.

ParentView is a UIView that contains CustomView.

With Storyboard, is it possible to create an auto-layout constraint that center aligns CustomButton with another button in ParentView?


Solution

  • No it is not possible to do what you are trying to do in storyboard. You would have to do it programatically.