I saw on the developer site that iOSLayoutConstraints can be named in the IDE?
// "TAWidth" is a width constraint for a TextField that has been given
// a name in the auto-layout Inspector properties.
Dim c As iOSLayoutConstraint = Self.Constraint("TAWidth")
c.Active = False
But I can’t locate a field for naming a constraint in the Inspector. There’s a “name” field at the top of the inspector for the name of the control, but in auto-layout I can’t see anywhere specific for naming the constraint.
Does it mean to just add a property to the view (multiple constraints for each control, generally) and assign them all to the relevant control constraints on Open?
You name each property. For instance if you click Edit for Top in Auto Layout, you will have on top of the constraint a blank field where you can enter for instance “myTop” which will be the name by which you address the control Top.
Thanks Michel, much appreciated! (feeling a little dense not spotting that one!)
Don’t beat yourself. You would not believe the kind of question were asked in Beta last year. iOS is a horse of a different color.
iOS is a bit of a bore when it comes to constraints names. It would seem logical to use the Desktop Control.Top for instance, but since Auto Layout can have several Top to accomodate Min and Max as well, you can end up with three Top per control. Hence the naming thing.
Also see the Auto-Layout section of the iOS Guide.