Search code examples
iosautolayoutstoryboardnslayoutconstraint

Center a view without a container view?


Using constraint, is it possible to vertically center a view in storyboards without creating a container view?

vertically center image in storyboard

Update: To be clear, I want the describe the vertical centering with constraints, so that it will remain vertically centered on device screens with different sizes. (i.e. I don't want to manually make the top and bottom constraint the same value.)


Solution

  • No, it is not possible without writing code