Hi All, I’m trying to get my head around Auto Layout in XXCode, but can’t seem to figure out some basic things.
I have a sample project with a View made up of two Controls, a Text Field and a Button, like so: | [TextView] [Button] | Where | = edge of the View. It has the following constraints at the moment: 1. Leading Alignment First Item: Button.Leading Relation: Equal Second Item: TextView.Leading Constant: 8 Priority: 1000 Multiplier: 1 2. Vertical Space First Item: Superview.Bottom Relation: Equal Second Item: Button.Bottom Constant: 5 Priority: 1000 Multiplier: 1 3. Vertical Space First Item: Button.Top Relation: Equal Second Item: Superview.Top Constant: 5 Priority: 1000 Multiplier: 1 4. Baseline Alignment First Item: Button.Baseline Relation: Equal Second Item: TextView.Baseline Constant: 0 Priority: 1000 Multiplier: 1 5. Horizontal Space First Item: Superview.Trailing Relation: Equal Second Item: Button.Trailing Constant: 5 Priority: 1000 Multiplier: 1 I now, want to move the button so it’s before the text field, like so: | [Button] [TextView] | If I just move the button to the left, it doesn’t work, so I’m guessing I need to change the constraints or somehow get XCode to do it for me? When I click on the Button in XCode, I see that it is hooked to the top, bottom and right edge of the superview and the left edge of the TextView. How do I change this so that it’s hooked to the top, bottom, and left edge of the superview and the left edge of the TextView? Is there a good doc that explains how to use XCode to do this? Not sure if this is a Cocoa or XCode question, so I’ve posted to both lists. All the Best Dave _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
