1. <small id='8w91j'></small><noframes id='8w91j'>

        <bdo id='8w91j'></bdo><ul id='8w91j'></ul>

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

      1. <tfoot id='8w91j'></tfoot>
      2. <legend id='8w91j'><style id='8w91j'><dir id='8w91j'><q id='8w91j'></q></dir></style></legend>
      3. 使 UIButton 占屏幕大小的百分比

        时间:2023-07-07

          • <bdo id='f7QBm'></bdo><ul id='f7QBm'></ul>

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

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

                  本文介绍了使 UIButton 占屏幕大小的百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我注意到某些按钮尺寸在 iPhone 5 模拟器上看起来很棒,但在 iPhone 6 模拟器上看起来不那么好,这是因为我放置在 UIButtons 上的高度或约束最终会留下很多空白空间我的应用屏幕底部.

                  I noticed certain button sizes look great on one the iPhone 5 simulator but do not look as good on the iPhone 6 simulator and this is because the heights or constraints that I place on the UIButtons end up leaving a lot of blank space down the bottom of my App Screen.

                  无论我在什么设备上模拟,我都希望有一个屏幕大小为 40% 的按钮.

                  I would like to have a button that is 40% of the screen size regardless of what device I am simulating on.

                  关于如何使按钮的大小保持在屏幕大小的 40% 而与设备无关的任何想法?

                  Any ideas on how to make the size of the button stay 40% of the screen size regardless of the device?

                  推荐答案

                  1. Ctrl 从按钮拖到 superview 并选择 Equal Widths
                  2. Open Size Inspector 编辑 Equal Widths 约束并将乘数设置为 0.4.你会看到这样的东西:

                  1. Ctrl drag from button to superview and select Equal Widths
                  2. Open Size Inspector edit Equal Widths constraint and set multiplier to 0.4. And you will see something like this:

                  添加缺失的约束并更新帧.

                  Add missing constraints and update frames.

                  这篇关于使 UIButton 占屏幕大小的百分比的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在uisearchbar中始终显示Xbutton(清除按钮) 下一篇:跟随圆的外部路径的uibuttons跟随手指的旋转动画

                  相关文章

                2. <small id='Ha0NO'></small><noframes id='Ha0NO'>

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

                      <legend id='Ha0NO'><style id='Ha0NO'><dir id='Ha0NO'><q id='Ha0NO'></q></dir></style></legend>

                    1. <i id='Ha0NO'><tr id='Ha0NO'><dt id='Ha0NO'><q id='Ha0NO'><span id='Ha0NO'><b id='Ha0NO'><form id='Ha0NO'><ins id='Ha0NO'></ins><ul id='Ha0NO'></ul><sub id='Ha0NO'></sub></form><legend id='Ha0NO'></legend><bdo id='Ha0NO'><pre id='Ha0NO'><center id='Ha0NO'></center></pre></bdo></b><th id='Ha0NO'></th></span></q></dt></tr></i><div id='Ha0NO'><tfoot id='Ha0NO'></tfoot><dl id='Ha0NO'><fieldset id='Ha0NO'></fieldset></dl></div>
                      <tfoot id='Ha0NO'></tfoot>