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

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

      2. <tfoot id='YsAhm'></tfoot>

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

        自动布局:将约束添加到超级视图而不是顶部布局指南?

        Autolayout: Add constraint to superview and not Top Layout Guide?(自动布局:将约束添加到超级视图而不是顶部布局指南?)

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

                <tbody id='IU1rZ'></tbody>
              <legend id='IU1rZ'><style id='IU1rZ'><dir id='IU1rZ'><q id='IU1rZ'></q></dir></style></legend>

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

                • 本文介绍了自动布局:将约束添加到超级视图而不是顶部布局指南?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在情节提要中的 UIViewController 中有一个 UIView,我想在该空间上添加一个约束,该视图距顶部边缘有一段距离.

                  I have a UIView in my UIViewController in storyboard which I want to add a constraint on to space that view a distance from the top edge.

                  现在,当我按常规按 ctrl + 拖动到 ViewController 的主视图时,我只能选择将其设置为顶部布局指南.

                  Now, when I do the usual by ctrl + drag to the ViewController's main view I only get option to set it to top layout guide.

                  这对我来说是个问题,因为在应用程序的某一时刻,我要将主视图向上移动 20-50 像素左右,然后发生的情况是我拥有的视图不会移动......因为它与超级视图不对齐.

                  This is a problem for me because at one point in the app Im going to move the main view up around 20-50px and what happens then is that view I have will not move... because its not aligned to superview.

                  如何在情节提要中手动执行此操作,还是必须以编程方式添加?

                  How can I manually do this in storyboard or do I have to add it programatically?

                  我使用的是 xcode 6.

                  Im using xcode 6.

                  推荐答案

                  约束常量值右侧有一个箭头.如果单击它,会弹出一个菜单,您可以在其中选择要相对于什么进行约束.如果您选择查看",它会将其固定在视图的顶部.

                  There is an arrow to the right of the constraint constant value. If you click on it, a menu pops out where you can choose what is it that you want to make your constraint relative to. If you choose 'View', than it will pin it to the top of the view.

                  这篇关于自动布局:将约束添加到超级视图而不是顶部布局指南?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  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屋-程序员
                  <tfoot id='uguWD'></tfoot>
                    <tbody id='uguWD'></tbody>

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

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

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