• <tfoot id='SxY2Q'></tfoot>

  • <legend id='SxY2Q'><style id='SxY2Q'><dir id='SxY2Q'><q id='SxY2Q'></q></dir></style></legend>
    <i id='SxY2Q'><tr id='SxY2Q'><dt id='SxY2Q'><q id='SxY2Q'><span id='SxY2Q'><b id='SxY2Q'><form id='SxY2Q'><ins id='SxY2Q'></ins><ul id='SxY2Q'></ul><sub id='SxY2Q'></sub></form><legend id='SxY2Q'></legend><bdo id='SxY2Q'><pre id='SxY2Q'><center id='SxY2Q'></center></pre></bdo></b><th id='SxY2Q'></th></span></q></dt></tr></i><div id='SxY2Q'><tfoot id='SxY2Q'></tfoot><dl id='SxY2Q'><fieldset id='SxY2Q'></fieldset></dl></div>

          <bdo id='SxY2Q'></bdo><ul id='SxY2Q'></ul>

        <small id='SxY2Q'></small><noframes id='SxY2Q'>

      1. 并排排列 3 个 UIButtons(等宽)

        时间:2023-07-07

            <tbody id='AhQA0'></tbody>
            <bdo id='AhQA0'></bdo><ul id='AhQA0'></ul>

              • <small id='AhQA0'></small><noframes id='AhQA0'>

              • <legend id='AhQA0'><style id='AhQA0'><dir id='AhQA0'><q id='AhQA0'></q></dir></style></legend>
                  <tfoot id='AhQA0'></tfoot>
                • <i id='AhQA0'><tr id='AhQA0'><dt id='AhQA0'><q id='AhQA0'><span id='AhQA0'><b id='AhQA0'><form id='AhQA0'><ins id='AhQA0'></ins><ul id='AhQA0'></ul><sub id='AhQA0'></sub></form><legend id='AhQA0'></legend><bdo id='AhQA0'><pre id='AhQA0'><center id='AhQA0'></center></pre></bdo></b><th id='AhQA0'></th></span></q></dt></tr></i><div id='AhQA0'><tfoot id='AhQA0'></tfoot><dl id='AhQA0'><fieldset id='AhQA0'></fieldset></dl></div>

                  本文介绍了并排排列 3 个 UIButtons(等宽)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何并排排列 3 个 UIButton.我正在使用自动布局.我的要求是:

                  How to arrange 3 UIButtons side-by-side.I am using Auto-layout. My requirement is:

                  1.无论设备如何,它们的宽度都应该相同

                  1.they should be equal width regardless of device

                  2.垂直占据视图的起点到终点

                  2.occupy vertically from starting to end of the view

                  我尝试了不同的方法,但未能实现.是否可以通过界面生成器实现

                  i tried different ways, i failed to achieve that. Is it possible through interface builder

                  推荐答案

                  有两种方法可以做到这一点.

                  There are 2 ways to do this.

                  方式一:

                  使用按钮的等宽限制

                  选择所有 3 个按钮并添加

                  Select all 3 buttons and add

                  上、左、右、高和等宽

                  方式2:使用堆栈视图

                  第 1 步: 添加 3 个按钮.

                  第 2 步: 选择所有按钮,选择后,单击右下角自动布局工具栏中的 堆栈按钮的故事板画布.见下图.

                  Step 2: Select all that buttons, Once you selected, click on the Stack button in the Auto Layout toolbar at the bottom right of the storyboard canvas. see below in image.

                  您也可以嵌入 From Editor -> Embed in -> StackView

                  第 3 步:约束 添加到 StackView.如下所示.

                  Step 3: Add Constraints to StackView. like below.

                  第 4 步:选择 StackView,选择后转到 属性检查器.将 Distribution 更改为 Fill Equally:

                  Step 4: Select StackView, Once selected go to Attributes inspector. Change the Distribution to Fill Equally:

                  它完成了!

                  这篇关于并排排列 3 个 UIButtons(等宽)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:屏幕底部的 UIButton 仅间歇性突出显示 下一篇:创建一个 for 循环以将 39 个按钮添加到数组中

                  相关文章

                  <i id='32FOf'><tr id='32FOf'><dt id='32FOf'><q id='32FOf'><span id='32FOf'><b id='32FOf'><form id='32FOf'><ins id='32FOf'></ins><ul id='32FOf'></ul><sub id='32FOf'></sub></form><legend id='32FOf'></legend><bdo id='32FOf'><pre id='32FOf'><center id='32FOf'></center></pre></bdo></b><th id='32FOf'></th></span></q></dt></tr></i><div id='32FOf'><tfoot id='32FOf'></tfoot><dl id='32FOf'><fieldset id='32FOf'></fieldset></dl></div>
                • <legend id='32FOf'><style id='32FOf'><dir id='32FOf'><q id='32FOf'></q></dir></style></legend>

                  <small id='32FOf'></small><noframes id='32FOf'>

                • <tfoot id='32FOf'></tfoot>
                  • <bdo id='32FOf'></bdo><ul id='32FOf'></ul>