I am trying to understand this new constraint thingy.
Taken from the LR, I placed this in a button :
Dim LeLeft As New iOSLayoutConstraint(TextField1, _
iOSLayoutConstraint.AttributeTypes.Left, _
iOSLayoutConstraint.RelationTypes.Equal, _
self, iOSLayoutConstraint.AttributeTypes.Left, _
1.0, 50)
I was expecting Left to become 50. Nothing happens. What am I missing ?
No, I did not add any named constraints to the control in the IDE. I am precisely trying this new method for me, because all I used one year and a half ago was named constraints.
Yes, I miss a constraints() property where you can see all constraints not only retrieve ones you know the names of too.
But I am sorry, I missed the bug above: After defining a constraint, you must add it to the iOSView using addConstraint. Works for me with your code slightly modified.
[quote=288589:@Ulrich Bogun]Yes, I miss a constraints() property where you can see all constraints not only retrieve ones you know the names of too.
But I am sorry, I missed the bug above: After defining a constraint, you must add it to the iOSView using addConstraint. Works for me with your code slightly modified.[/quote]
For what it’s worth, there’s an app called Reveal which lets you see all of the layers and constraints. We use this for debugging layout issues in the XDC iOS app.
Interesting, thanks, Greg!
And, FWIW, iOSLib in AppleLib does have a constraints() property. I started experimenting with the new layoutAnchors in it but I usually end up resizing exactly the wrong view