需要帮助并排设置自动布局宽度相等的两个按钮,侧面 [英] Need assistance setting two buttons of equal width, side by side Autolayout
问题描述
使用自动布局我想在这样的底部创建两个按钮
拖着两个按钮后,我设置这样的限制
在后退按钮
我设置前导空格集装箱保证金
和底空间底部布局指南
On Back button
I set Leading Space to Container Margin
and Bottom Space to Bottom Layout Guide
在跳转到设置按钮
我设置尾随空格集装箱保证金
和底部空间到底部布局指南
On Go To Settings button
I set Trailing Space to Container Margin
and Bottom Space to Bottom Layout Guide
然后我 CTRL +拖动
从后退按钮
到前往设置按钮
并设置宽度相等
约束,我得到这个。
Then I ctrl+Drag
from Back button
to Go To Settings button
and set the Equal Widths
constraint and I get this.
然后我更新后退按钮
宽度相同跳转到设置按钮
是 101
和所有的约束变成蓝色。
Then I update the Back button
width same as Go To Settings button
which is 101
and all constraints turn to blue.
但我想两个按键可覆盖半个屏幕无论是屏幕的大小是什么,在第一个屏幕截图所示相同,如何做到这一点?
推荐答案
您可以使用相同的宽度,以这样的第二个按钮来完成它。
you can done it using equal width to 2nd button like this
和输出
下面是<一个href=\"https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/ViewswithIntrinsicContentSize.html#//apple_ref/doc/uid/TP40010853-CH13-SW4\"相对=nofollow>苹果指南
这篇关于需要帮助并排设置自动布局宽度相等的两个按钮,侧面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!