简体   繁体   中英

constraints not working properly, Xcode

what is the reason my constraints are off, i am running it on an iphone7 simulator and I can't get it right. Not sure what other information I can provide, all the details of my constraints are in the images.

在此处输入图片说明

在此处输入图片说明 在此处输入图片说明

I suggest you use a button as the background. (The purple thing) And a plain UILabel as the text.

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个按钮,并在一个时间点向它们添加了约束,并在“添加新的约束”选项卡中设置了相等的宽度和高度。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM