The problem turned out to be the thingy at the bottom of Xcode which lets you 
set constraints for leading, trailing, top and bottom, etc. 
This offers constraints to the superview, which is not the box, but the content 
view of the box, which is not useful for constraints at all. 
One could argue that it is a bug that Xcode offers this useless superview, or 
that it does not offer constraints to the box. 

The solution is to control-drag from the item  in the box to the box itself and 
then choose the appropiate constraint. 

Gerriet



Sent from my iPhone

> On 11 Apr 2016, at 13:56, Ulf Dunkel <[email protected]> wrote:
> 
> The miracle of your question seems to stick in the message: “Unable to 
> simultaneously satisfy constraints:…” - As long as we don't know which 
> constraints should be satisfied simultaneously, we can only guess. My guess 
> is that you might want to remove the height=20 constraint. What about 
> wrapping text?
> 
> ---Ulf Dunkel
> 
> - - - - -
> 
>> Am 10.03.2016 um 07:22 schrieb Gerriet M. Denkmann:
>> I created a new OS X Application with Xcode Version 7.2.1 (7C1002).
>> 
>> In the middle of the window I placed an NSTextField.
>> 
>> Xcode → Editor → Embed In… → Box.
>> 
>> Set Top, Bottom, Leading, Trailing of Box to SuperView (window) = Default 
>> Set Top, Bottom, Leading, Trailing of TextField to SuperView (box) = Default 
>> TextField width ≥ 200
>> TextField heigth = 20
>> 
>> 1. Xcode tells me that TextField needs constraints for y position or height. 
>> Why?
>> 
>> 2. When I run the app, I get told “Unable to simultaneously satisfy 
>> constraints:…”
>> 
>> 3. I can resize the window so that the TextField clearly get smaller than 
>> 200.
>> 
>> None of these problems for a TextField outside of the box.
>> 
>> I know that thinking outside the box is considered a virtue, but being able 
>> to do autolayout in a box would also be a good think.
>> 
>> How can this be done?
>> 
>> Gerriet.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/xcode-users/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to