Reputation: 15
See the screenshot below for the example but here is the issue. I have 3 text labels and I'm trying to line those labels up with 3 circles that are part of an Image View. It appears the issue is caused when the image is set to Aspect Fit and gets scaled along with the various iPhone sizes. I can align the text labels horizontally but I cannot figure out how to set the vertical constraints to "scale" properly. Any suggestions or direction would be awesome, thanks!
Upvotes: 1
Views: 224
Reputation: 1223
Control drag from the label to the image and you will get a list of constraint options. Select the "Center Vertically" and "Center Horizontally" options. Then the label will be constrained to the center of the image like you want. It works. See the attached images; I did it on an iPhone 6s as well as an iPad Pro just to show that it will scale with any size.
Upvotes: 0
Reputation: 1236
Are you setting constant for your vertical constraint? Try to set the vertical constraint against the height of the view. One way to achieve this is to set the Center horizontally
constraint and change the multiplier to 1.8 or something that suits.
Upvotes: 1