Reputation: 179
Tried a lot of combinations with the x,y,width and height using auto layout but have had no luck. For frame of reference check out this image of iPhone 7s on storyboard
*Remember the OFF in relation to the fries in the background
Then check out this
I'm very confused on what to do.
Upvotes: 0
Views: 50
Reputation: 931
If you want a View to be in a certain portion of its superview, you can use align constraint with multiplier. First apply these constraints you your view:
Then modify each of the multiplier to the portion you want it to be, from the center to the edge is between value 1 to 2:
Note the values I used(1.7 & 1.9) brings the center of the view to 70% and 90% point between the center and edge of the superview. Having the multiplier at 2 will guarantee half your view be outside your superview.
Reminder too that these two constraints only determines the X and Y position of your view. You will need to add more to determine its width and height which I did beforehand.
Upvotes: 3