• <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>

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

        时间:2023-09-11

      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.

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

                  上一篇:自 Xcode 8 和 iOS10 以来,viewDidLayoutSubviews 上的视图大小不正确 下一篇:在自动布局中将子视图的 X 居中会引发“未为约束做好准备";

                  相关文章

                  <tfoot id='uguWD'></tfoot>

                    <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>
                    1. <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>