Search code examples
iosxcodestoryboardiphone-xsafearealayoutguide

Xcode Storyboard make button height equal to bottom layout guides (or the space below the safe area) + a constant?


I would like to have my button height to be equal to a constant + the space between the bottom of the safe area and the superview bottom (or what was before called "Bottom layout guides" and set it from the storyboard maybe with a constraint or something, but not programmatically.


Solution

  • You can only bind the constraint to a view, so if you really wanna do it from SB insert a 0 width / clear view that you constrain to be "the space between the bottom of the safe area and the superview bottom" and set the button to be equal to that view's height + your constraint