文本视图和图像视图从 Xcode 6.1 故事板中的视图控制器中消失 [英] Text views and image view disappearing from view controller in Xcode 6.1 storyboard

查看:19
本文介绍了文本视图和图像视图从 Xcode 6.1 故事板中的视图控制器中消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更新到 Xcode 6.1 以修复我在使用情节提要时使用 Interface Builder Cocoa Touch Tool 时 CPU 使用率飙升至 99% 的错误,这将冻结 Xcode.现在该错误已修复,我可能遇到了一个更令人沮丧的错误.

I updated to Xcode 6.1 to fix an error I was having with the Interface Builder Cocoa Touch Tool spiking to 99% CPU usage when I used the storyboard, which would freeze Xcode. Now that that error is fixed, I have a possibly even more frustrating error.

当我使用情节提要时,我正在处理 UIViewController、我的 UITextView、我的自定义 UITextView(它们是子类)UITextView,但对于故事板中的所有意图和目的,它们是 UITextView),我的 UIImageView 突然消失了!

When I use the storyboard, while I'm working on a UIViewController, my UITextView, my custom UITextViews (which are subclasses of UITextView, but for all intents and purposes in the storyboard, they're UITextViews), and my UIImageView suddenly disappear!

这是我的视图控制器中的默认主视图现在的样子:

Here's how the default main view inside my view controller looks right now:

主视图

  • 查看
    • 活动指示器
    • 标签
    • 文本视图(x=0, y=-65, width=0, height=0) 错误!
    • 标签
    • 自定义文本视图(x=0, y=-65, width=0, height=0) 错误!
    • 标签
    • 自定义文本视图(x=0, y=-65, width=0, height=0) 错误!
    • 标签
    • 自定义文本视图(x=0, y=-65, width=0, height=0) 错误!
    • 标签
    • 标签
    • 自定义文本视图
    • 查看
      • 查看
        • 标签
        • 按钮
        • Label
        • Text view (x=0, y=-65, width=0, height=0) ERROR!
        • Label
        • Custom text view (x=0, y=-65, width=0, height=0) ERROR!
        • Label
        • Custom text view (x=0, y=-65, width=0, height=0) ERROR!
        • Label
        • Custom text view (x=0, y=-65, width=0, height=0) ERROR!
        • Label
        • Label
        • Custom text view
        • View
          • View
            • Label
            • Button
            • 标签
            • 自定义文本视图(x=0, y=-526, width=0, height=0) 错误!
            • 此视图的宽度和高度约束.

            当我使用自由格式"调整视图控制器的大小以查看视图控制器屏幕之外的视图时,这一切都开始了.一旦我使用 cmd-Z 将视图控制器改回固定"(正常大小),丢失的元素再次出现,一切看起来都很好.然而,后来,我正在编辑视图控制器,突然……砰!他们走了.当我将它们全部重置到它们应该在的位置时,它又发生了(导致上述 x、y、宽度、高度值).

            It all started when I adjusted the size of the view controller using "freeform" in order to see views that were off the view controller screen. Once I used cmd-Z to change the view controller back to "fixed" (to the normal size), the missing elements appeared again and everything seemed fine. However, later on, I was editing the view controller and suddenly...bam! They're gone. And when I reset all of them to where they were supposed to be, it just happened again (resulting in the above described x, y, width, height values).

            :-(

            有谁知道可能出了什么问题?我在 Xcode 5 中从未遇到过这个错误.

            Does anyone know what could be wrong? I never had this error in Xcode 5.


            我能够使用 cmd-Z 使视图控制器恢复正常.然后我重新启动了我的 mac 并重新打开了 Xcode.现在,我注意到每当我通过用光标拖动来调整情节提要中任何内容的大小时都会发生错误(如果我使用 Xcode 右侧面板上的宽度和高度属性调整某些内容的大小,则不会发生这种情况).它也发生在其他视图控制器上.即使在默认主视图中只有 UILabelUIImageView 的视图控制器中,当我单击并拖动标签的边缘以调整其大小时,图像视图以 x=0、y=-64、height=0、width=0 的值消失.


            I was able to use cmd-Z to get the view controller back to normal. Then I restarted my mac and reopened Xcode. Now, I've noticed that the error occurs whenever I resize anything in the storyboard by dragging with the cursor (it doesn't happen if I resize something using the width and height properties on the right panel in Xcode). It happens on other view controllers as well. Even in a view controller that has only a UILabel and a UIImageView in the default main view, when I click and drag the edge of the label to resize it, the image view disappears with values of x=0, y=-64, height=0, width=0.

            简明扼要:
            在 Xcode 6.1 故事板中,每次我调整 UIViewController 中任何元素的大小时,所有 UITextViewUIImageView 都会折叠并被推到 -64 像素在视图控制器的左上角上方.

            CONCISE SUMMARY:
            In the Xcode 6.1 storyboard, every time I resize any elements in a UIViewController, all UITextViews and UIImageViews collapse and get shoved -64 pixels above the upper left corner of the view controller.

            更新
            Xcode 6.1.1 似乎已经修复了这个错误.

            UPDATE
            It appears that Xcode 6.1.1 has fixed the bug.

            推荐答案

            另一种解决方法是在调整任何视图大小之前向布局添加约束.(添加缺少的约束,例如).该错误似乎仅在没有可用约束时发生.我已使用 Bugreporter 向 Apple 报告了该错误.

            Another workaround is to add constraints to the layout Before resizing of any views. (add missing constraints e.g.). The bug only seems to occur when there are no constraints available. I have reported the bug to Apple with Bugreporter.

            所以,至少 Apple Bugreporter 似乎在工作.该问题在 XCode v 6.1.1 中得到修复.

            So, at least it seems that Apple Bugreporter is working. The problem is fixed in XCode v 6.1.1.

            这篇关于文本视图和图像视图从 Xcode 6.1 故事板中的视图控制器中消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆