Ambiguous Layout: Position and size are ambiguous for "Stack View"

I am building a Settings screen using Storyboard and UITableViewController with Static Cells.

Here is a full view hierarchy and constraints I use for every cell in my Settings Table View: https://cln.sh/tAmFbl

The problem appears when I switch portrait mode on landscape mode or switch to device with a smaller screen. Starting to receive an errors like:

Ambiguous Layout: Position and size are ambiguous for "Stack View".

And:

Stack View, need constraints for: X position, width
Stack View, need constraints for: Y position, height

Here is a picture of the behaviour: https://cln.sh/fq6kOK

If I switch back to portrait mode all errors goes away...

How can I fix that?

Replies

It looks like its telling you that you have not specified a width or height and its not sure now to layout the view. Have you set that constraint already ? That or maybe you have conflicting constraints and its not sure which one to use.

  • Hei, Turtle. Thank you for the reply. But why should I set the fixed width and height for the StackView if the width is different for iPhone 11 and iPhone SE? For now its set for the StackView to its Superview (cell - contentView) with top/bottom/trailing/leading...

Add a Comment