简体   繁体   English

如何向以下两个按钮添加约束

[英]How to add constraints to the following two buttons

I have the following View which contains two buttons and a date picker and I am using AutoLayout. 我有以下视图,其中包含两个按钮和一个日期选择器,并且正在使用自动版式。

在此处输入图片说明

Both buttons have 0 space for bottom, top, leading and trailing edge. 两个按钮的下,上,前和后沿都有0个空间。 How can I set constraints to the buttons so that they look like in the picture. 如何为按钮设置约束,以使其在图片中看起来像。

I tried setting 0 for leading, trailing, bottom and top and set fixed height, but one buttons has the width bigger than the other one. 我尝试将0设置为开头,结尾,底部和顶部,并设置固定高度,但是一个按钮的宽度大于另一个按钮的宽度。

I want them to have same width. 我希望它们具有相同的宽度。 Any ideas how can fix this ? 有什么想法可以解决这个问题吗?

Ctrl +从一个按钮拖动到另一个按钮,然后添加“等宽”约束。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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