<tfoot id='l9fCi'></tfoot>
  • <legend id='l9fCi'><style id='l9fCi'><dir id='l9fCi'><q id='l9fCi'></q></dir></style></legend>

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

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

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

      1. 每次 Xcode 重新启动时视图错位

        时间:2023-09-10
          <legend id='3U43M'><style id='3U43M'><dir id='3U43M'><q id='3U43M'></q></dir></style></legend>

          <small id='3U43M'></small><noframes id='3U43M'>

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

                    <tbody id='3U43M'></tbody>
                1. 本文介绍了每次 Xcode 重新启动时视图错位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我第一次在我的应用中使用故事板

                  I'm using storyboards for the first time in my app

                  当我关闭 Xcode 时,我收到了 0 个关于错位视图或与我的故事板有关的任何内容的警告.当我重新启动 Xcode 并打开情节提要时,我的 15 个场景中有 3 个有错位的视图警告.

                  When I close Xcode, I have 0 warnings about misplaced views or anything pertaining to my storyboard. When I restart Xcode and open the storyboard, 3 out of my 15 scenes have misplaced view warnings.

                  不碰任何东西(除了选择文件),我可以发出一个 git status 并看到 .storyboard 文件发生了变化.如果我 git diff,我会在文件的多个区域看到此内容:

                  Without touching anything (other than selecting the file), I can issue a git status and see that the .storyboard file has changes. If I git diff, I see this included in multiple areas of the file:

                  <variation key="widthClass=compact" misplaced="YES">
                      <rect key="frame" x="8" y="56" width="130" height="34"/>
                  </variation>
                  

                  如果一个元素已经有 <variation key="widthClass=Compact" 节点,则添加 misplaced 属性和 rect 节点.

                  If an element already had <variation key="widthClass=Compact" node, then the misplaced attribute and rect node are added.

                  要让警告消失,我唯一要做的就是单击每个警告,确保选中更新框架",然后单击修复错位".在我重新启动 Xcode 之前,这会解决所有问题.

                  The only thing I have to do to get the warnings to go away is click on each one, make sure "Update Frame" is selected, and click "Fix Misplacement". That fixes everything until I restart Xcode.

                  我的场景的基本结构是:

                  The basic structure of my scene is:

                  UIView
                      UICollectionView
                          UICollectionReusableView
                          UICollectionViewCell
                          UICollectionViewCell
                      UISegmentedControl
                  

                  如何防止每次重新启动时发生这种情况?

                  How can I prevent this from happening each time I restart?

                  推荐答案

                  在我的例子中,所有具有自定义字体和固有(未明确定义)大小的标签/按钮都会发生这种情况.看起来像 Xcode 错误.

                  In my case it happens for all labels / buttons with custom fonts and intrinsic (not explicitly defined) sizes. Looks like an Xcode bug.

                  这篇关于每次 Xcode 重新启动时视图错位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:具有动态高度多个UILabel的UIView 下一篇:视图出现后应用的 iOS 8/XCode 6 自动布局约束

                  相关文章

                  <legend id='17uxQ'><style id='17uxQ'><dir id='17uxQ'><q id='17uxQ'></q></dir></style></legend>
                2. <small id='17uxQ'></small><noframes id='17uxQ'>

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

                      • <bdo id='17uxQ'></bdo><ul id='17uxQ'></ul>