你有什么应用自动布局约束排队与背景图像元素的标签? [英] What do you apply auto layout constraints to line up labels with background image elements?

查看:131
本文介绍了你有什么应用自动布局约束排队与背景图像元素的标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

见下面的示例中的截图,但这里的问题。我有3个文本标签和我试图排队这些标签与3圈是一个图像视图的一部分。看来当图像被设置为宽拟合,并得到与各iPhone尺寸沿缩放的问题引起的。我可以水平对齐文本标签,但我想不出如何设置垂直约束规模的正确。任何建议或方向将是真棒,谢谢!

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!

在这里输入的形象描述

推荐答案

您为您的垂直约束设置不变?尝试设置垂直约束对视图的高度。实现这一目标的一种方法是横向设置中心约束,将放大倍数1.8或适合。

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.

这篇关于你有什么应用自动布局约束排队与背景图像元素的标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆