How to create constraints between non-sibling views?
How to create constraints between non-sibling views?
- Subject: How to create constraints between non-sibling views?
- From: Jens Alfke <email@hidden>
- Date: Sat, 05 May 2012 13:00:36 -0700
I’m trying to use constraints in my UI, and I’m really frustrated trying to manage them in IB. I’ve figured out some of the issues (the inability to delete automatic constraints is really, really, REALLY unintuitive!) but I’m stuck on this one:
Q: How do I add a constraint between two items in different superviews?
The meager online docs say to select the two items, then “choose a constraint from the Editor > Add Constraint menu or the Editor > Alignment menu.”. There is no “Add Constraint” submenu at all in Xcode 4.3. There is an “Align” (not “Alignment”) submenu, but all of its items are disabled when the two selected views aren’t siblings (even though the AppKit guide promises that you can create constraints between views in different containers.)
I can add the constraint in code, but then it conflicts with the automatically-applied constraints, causing crazy behavior at runtime. The only workaround I’ve found for this is to reduce the priority of the automatic constraint to 1, since it’s impossible to delete it. But that seems like a kludge.
—Jens
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden