需要帮助并排设置自动布局宽度相等的两个按钮,侧面 [英] Need assistance setting two buttons of equal width, side by side Autolayout

查看:166
本文介绍了需要帮助并排设置自动布局宽度相等的两个按钮,侧面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用自动布局我想在这样的底部创建两个按钮

拖着两个按钮后,我设置这样的限制

后退按钮我设置前导空格集装箱保证金底空间底部布局指南

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屋!

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