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

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

        <tfoot id='wmDcO'></tfoot>

        <legend id='wmDcO'><style id='wmDcO'><dir id='wmDcO'><q id='wmDcO'></q></dir></style></legend>
        • <bdo id='wmDcO'></bdo><ul id='wmDcO'></ul>

      2. Xcode AutoLayout,使边距与高度成比例

        时间:2023-09-10

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

              1. <small id='sPUvP'></small><noframes id='sPUvP'>

                  <bdo id='sPUvP'></bdo><ul id='sPUvP'></ul>
                  本文介绍了Xcode AutoLayout,使边距与高度成比例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我很想弄清楚如何使两个对象的边距成比例.如果我在 Xcode 上选择纵横比,它会给我调整对象比例屏幕高度的选项.那不是我的情况.我希望按钮和屏幕底部之间的边距与屏幕高度成正比.我希望它使用 Xcode无代码"来完成.

                  I am having a big time figuring out how to make the margin of two objects proportional. If i choose aspect ratio on Xcode it gives me the option for adjust the height of my object proportional screen height. and thats not my case. I want the margin between a button and screen bottom to be proportional to screen height. And i want it to be done using Xcode "No Code".

                  非常感谢您的支持.

                  谢谢

                  推荐答案

                  使用 NSLayoutConstraint 的 multiplier 属性!

                  Use the multiplier property of NSLayoutConstraint !

                  首先,使用您希望的乘数设置从您的视图到其父视图的等高约束.您可以使用 Ctrl + 从您的视图拖动到超级视图.

                  First, set the equal height constraint from your view to its superview with the multiplier you wish. You can use Ctrl + drag from your view to the superview.

                  然后将另一个约束设置为从视图顶部到父视图的 0,以及从视图到父视图的等宽约束,乘数为 1.

                  Then set another constraint at 0 from the top of your view to the superview and a equal width constrain with a multiplier to 1 from your view to the superview.

                  完成!

                  这篇关于Xcode AutoLayout,使边距与高度成比例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:为什么 iOS 自动布局会导致预 Retina 显示器出现明显的舍入错误(包括单元测试) 下一篇:UITableView 的自动布局错误

                  相关文章

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

                    <small id='5Y5UG'></small><noframes id='5Y5UG'>

                    1. <tfoot id='5Y5UG'></tfoot>

                        <bdo id='5Y5UG'></bdo><ul id='5Y5UG'></ul>