菜鸟教程小白 发表于 2022-12-12 12:14:54

ios - xib(Xcode8)上UIView/UIImageView的大小变成(1000, 1000)


                                            <p><p>我在 xib 上使用自动布局来创建我的 UI。</p>

<p>当我完成我的 UI 时。它在模拟器上运行良好。</p>

<p>但是当我下次打开Xcode8时,xib显示奇怪。<br/>
有的 UIView 和 UIImageView 变大了。<br/>
大小变为 (1000, 1000)</p>

<p> <img src="/image/30m1J.jpg" alt="Wrong Size"/> </p>

<p>即便如此,当我在模拟器上运行时,它看起来还不错。<br/>
但是xib不能轻易修改。</p>

<p>我尝试更新框架。变得更糟</p>

<p> <img src="/image/1GaHy.png" alt="Worse after updating the frames"/> </p>

<p>我应该如何处理?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>这是 Xcode8 的问题。这在 Xcode8.1 beta2 中已修复。</p>

<blockquote>
<p>Xcode 8.0 did not always restore view frames from storyboards and xibs when layouts were
ambiguous. Xcode 8.1 fixes several of these issues. If you have encountered these issues, resolve the
ambiguity in the Auto Layout issues and update frames. Xcode 8.1 will persist them correctly.
(28221021, 28244619)</p>
</blockquote>

<p>详情可见<a href="http://adcdownload.apple.com/Documentation/Xcode_8.1_beta_3_SDK_Release_Notes/Release_Notes_for_Xcode_8.1_beta_3.pdf" rel="noreferrer noopener nofollow">release notes</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - xib(Xcode8)上UIView/UIImageView的大小变成(1000, 1000),我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/40081149/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/40081149/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - xib(Xcode8)上UIView/UIImageView的大小变成(1000, 1000)