Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two views are vertically ambiguous ,Xcode warning message dealing with contraints

enter image description here

The warning message i get is that 2 views are vertically ambiguous( looks fine when i run it btw)

The two views that its talking about is the two score labels. My first question is what does the warning mean and how would i be able to solve it.

Second question is. DO i need to put constraints on the other labels inside that same cell since they look fine with all the screen sizes since they start att the start from the left? Cause it was just the two score labels that were not showing in the smaller screens but the other labels were perfect.

Thank you.


1 Answers

I had the same problem yesterday, I know, we all hate having to waste ridiculous amounts of time with a terrible tool such as Xcode´s layout. The technique that worked for me is to create constraints from the top views to the bottom, usually 3 per view (Leading, Trailing and Top), plus the key part here: once the ambiguous error is the only warning left, let Xcode "add missing Constraints", which will usually be a horizontal center reference for one of the views. I used this article for reference: http://mobileoop.com/auto-layout-advanced-techniques-for-ios-8-and-7-using-xcode-6-on-storyboard

like image 152
Josh Avatar answered Feb 28 '26 15:02

Josh