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,使边距与高度成比例

        Xcode AutoLayout, Make Margin proportional with height(Xcode AutoLayout,使边距与高度成比例)

              <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 AutoLayout - get frame size width(iOS AutoLayout - 获取帧大小宽度)
                  Auto layout constraints issue on iOS7 in UITableViewCell(UITableViewCell中iOS7上的自动布局约束问题)
                  How to resize superview to fit all subviews with autolayout?(如何调整超级视图的大小以适应所有具有自动布局的子视图?)
                  Springs in Auto Layout: Distribute views evenly, with constraints, in Xcode 5(自动布局中的弹簧:在 Xcode 5 中使用约束均匀分布视图)
                  reloadData() of UITableView with Dynamic cell heights causes jumpy scrolling(具有动态单元格高度的 UITableView 的 reloadData() 导致跳跃滚动)
                  What is NSLayoutConstraint quot;UIView-Encapsulated-Layout-Heightquot; and how should I go about forcing it to recalculate cleanly?(什么是 NSLayoutConstraint“UIView-Encapsulated-Layout-Height?我应该如何强制它干净地重新计算?) - IT屋-程序员
                  • <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>
                      <tbody id='5Y5UG'></tbody>
                      <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>