• <legend id='FsjeB'><style id='FsjeB'><dir id='FsjeB'><q id='FsjeB'></q></dir></style></legend>

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

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

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

      <tfoot id='FsjeB'></tfoot>
      1. 视图出现后应用的 iOS 8/XCode 6 自动布局约束

        时间:2023-09-10

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

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

          2. <tfoot id='xhrZg'></tfoot>
              <bdo id='xhrZg'></bdo><ul id='xhrZg'></ul>
                    <tbody id='xhrZg'></tbody>

                  本文介绍了视图出现后应用的 iOS 8/XCode 6 自动布局约束的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I have a project that was working just fine with XCode 5 and iOS 7, but when I recently downloaded XCode 6, I noticed some weird behavior with autolayout.

                  I have a storyboard with a view that just has a UIImageView and two UILabels. This view gets loaded using a UiPageViewController. The UIImageView is centered horizontally and vertically in the view and there are constraints specifying the distance of the two labels from the image view. When there is a case when the storyboard and autolayout values conflict (for example, in the storyboard, one label is 20 pixels above the image view but the autolayout says it should be 40 pixels above), it used to be that the autolayout value was successfully applied before the view loaded. Thus, when the view gets shown for the first time, everything is in the right place.

                  Now with iOS 8 / XCode 6, I'm seeing that the view loads and then things jump to their final autolayout position. This jump is noticeable to the end user both in the simulator and on a real device, and it's really annoying. Is there a way to go back to the old behavior? As far as I'm aware, no code has changed to cause this issue.

                  解决方案

                  Where is your code that is making changes to your constraints?

                  If you're keeping it in viewWillAppear: you will have that problem. I found that viewDidLayoutSubviews works well for iOS8 but not always for iOS7 backwards.

                  Eventually, if you cant use viewDidLayoutSubviews, what I'd suggest is hide the container view in viewDidLoad and unhide it in viewWillAppear, only after the constraints have been applied. It gets you a small extra delay when loading the screen but the constraints change gets transparent to the user.

                  这篇关于视图出现后应用的 iOS 8/XCode 6 自动布局约束的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:每次 Xcode 重新启动时视图错位 下一篇:带有 ContentInset 的 UICollectionView 不会一直向下滚动

                  相关文章

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

                        <bdo id='Hg1rL'></bdo><ul id='Hg1rL'></ul>
                    1. <tfoot id='Hg1rL'></tfoot>

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