1
votes

I'm trying to layout views in a proportional way, for example 20% from top and 50% from left of the super view. and set the view center to this point.

I've tried doing this by setting a dummy view (orange) as seen below, but I can't seem to set the white view center as the anchor.

Any Ideas?

enter image description here

here are the constraints I've used:

enter image description here

1

1 Answers

1
votes

Easy, just set the view centerX and centerY instead of using top and left. that will use the views center as the anchor point