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

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

问题描述

我更新到Xcode 6.1来修复我使用Interface Builder Cocoa Touch Tool时出现的错误,当我使用故事板时,它会占用99%的CPU,这会冻结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 s(它们是<$ c的子类) $ c> UITextView ,但是对于故事板中的所有意图和目的,它们是 UITextView s),以及我的 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,宽度= 0,高度= 0)错误!

    • 标签

    • 自定义文字视图(x = 0,y = -65,宽度= 0,高度= 0)错误!

    • 标签

    • 自定义文字视图(x = 0,y = -65,宽度= 0,高度= 0) E RROR!

    • 标签

    • 自定义文字视图(x = 0,y = -65,宽度= 0,高度= 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

            • 标签

            • 自定义文字view (x = 0,y = -526,width = 0,height = 0)错误!

            • 此视图的宽度和高度约束。

            • Label
            • Custom text view (x=0, y=-526, width=0, height=0) ERROR!
            • Width and height Constraints for this view.

            当我使用自由形式调整视图控制器的大小以查看关闭v的视图时,一切都开始了iew控制器屏幕。一旦我使用cmd-Z将视图控制器更改回固定(正常大小),丢失的元素再次出现,一切似乎都很好。然而,后来,我正在编辑视图控制器,然后突然...... bam!他们走了。当我将所有这些重置到它们应该的位置时,它再次发生(导致上述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右侧面板上的宽度和高度属性调整大小,则不会发生这种情况。)它也会发生在其他视图控制器上。即使在查看控制器在默认主视图中只有 UILabel UIImageView ,当我单击并拖动边缘时要调整大小的标签,图像视图会消失,其值为x = 0,y = -64,高度= 0,宽度= 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 中的任何元素时,所有 UITextView s并且 UIImageView s崩溃并且在视图控制器的左上角上方有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天全站免登陆