[quote=206922:@Richard Albrecht] how to use the Min/Max in Constraints.
And how do you use percent?[/quote]
Let me start by percent, because that is where it starts (for me at least).
In a Desktop project, you have Left, Top, Width and Height. Setting these values in absolute work just fine for a fixed width window, and you can do that very precisely in the layout editor.
If the window is resized, you can use the locks, but it is not always perfect. The solution is to make the properties relative to the size of the window instead of absolute.
In Desktop there are no percentage, but you can use something similar, like this in the Resize event :
me.left = (self.width/100)*20
me.Top = (self.width/100)*30
and so on. That way when you resize the window, the control will resize accordingly.
That is what my class RubberViews does. Plus a lot more things, but the basic principle remains.
Now, in iOS, it is assumed that the user will rotate the device. So, let us imagine you have a circle in the view, and you want it to remain a circle when the user rotates, but you also want it to grow or shrink according to the portrait or landscape position.
Let us start by Height :
Height = Parent.Height * 25%
So on a phone 414x736 our circle will be 184 pixels high in Portrait, and 103 in Landscape.
Now, we want it to remain a circle, and not become an oval. So here comes the notion of relative to another control. Here, we want the width to always be the same as the height. Then
Width = Oval1.Height // Offset = zero
Here comes the priority.
We want first the height to be set relative to the parent. So Priority is required.
Then we want our width to be relative to that Height. Priority High.
Now, Min and Max.
Finally, what is this Scale thing in constraints ? I usually leave it at 100% for comfort, but it can be used to change the value of the constraint in proportions.
No matter if my app runs on iPad at 1024 x 768 or the iPhone 4 I was talking about above, I never want the circle to have a diameter of more than 200. If I let the previous height constraint go, 25% of 1024 would be 256.
I will then add a new width
Width < = 200 / Width Max Offset 200
I apologize to Xojo engineers if for some reason my description did not do justice to every detail of the way Auto Layout works. That is a pretty complex feat of engineering. But this is how I understand it. I hope this short example will help.