Reputation: 1043
I have a full screen ImageView (margins constraints) with an Image in "Aspect Fit Mode" and I need to have a button to be over a specific part of that image on all devices.
I have tried to put constraints in different ways, but without any good result.
I hope someone could help me.
Here you can find a screenshot of what I want:
The yellow block is the button and I want it to be over the shoulder for any screen size.
This is iOS 8.
Upvotes: 3
Views: 4913
Reputation: 43
just have to add center vertically & center horizontally and equal height and equal width to image and then play with multipliers to make it where you want.
Upvotes: 0
Reputation: 165
If both element on the same view, just drag the button bellow the image in the View Controller Scene, and you are done.
Upvotes: 1
Reputation: 5130
Try proportional Constraints. Add the following 4 constraints to your button (values are not exact)
Apple recommend using proportional constraints. Try to change the percent values slightly to fit the button on shoulder. Once you fit the button on shoulder with these constraints It will look fine on all device . Thanks
Upvotes: 5