[英]constraints not working properly, Xcode
I suggest you use a button as the background. 我建议您使用按钮作为背景。 (The purple thing) And a plain UILabel as the text. (紫色的东西)和一个普通的UILabel作为文本。
The good side about this is that it will be very easy to position. 好的方面是,它很容易定位。
The bad side of this is that having the text color change when on press gets a bit more complicated. 不利的一面是,印刷时更改文本颜色会变得更加复杂。
But about your constraints, of the text labels. 但是关于您的约束,文本标签。 Check the property inspector and adjust the text alignment so that it's centered. 检查属性检查器并调整文本对齐方式,使其居中。
我突出显示了底部的所有4个按钮,并在一个时间点向它们添加了约束,并在“添加新的约束”选项卡中设置了相等的宽度和高度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.