无法与IB中的约束进行插座连接 [英] Unable to make outlet connection to a constraint in IB

查看:123
本文介绍了无法与IB中的约束进行插座连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用iOS 7运行XCode 5.我需要在布局之前动态更改UITextView的高度约束。我看过许多帖子,说明这可以通过从IB中的约束到源代码建立出口连接来完成。我试图从IB中的约束出口连接到拥有类的头文件,但无法建立连接 - 当我拖动头文件时IB不会突出显示,就像在进行连接时一样来自按钮等其他对象。

I am running XCode 5 with iOS 7. I need to dynamically change the height constraint of a UITextView prior to its layout. I have seen many postings stating that this can be done by making an outlet connection from the constraint in IB to the source code. I am trying to make the connection from the constraint outlet in IB to the header file of the owning class, but am unable to make the connection - IB does not "highlight" when I drag over the header file, as it does when making connections from other objects like buttons etc.

有没有人遇到过这个?非常感谢所有帮助。

Has anyone encountered this before? All help is greatly appreciated.

推荐答案

这是我做这件事的照片。我控制 - 从约束拖到头文件。

Here is a picture of me doing it. I'm control-dragging from the constraint to the header file.

在现实生活中我更有可能控制 - 拖动到实现文件中的匿名类别,因为我没有希望IBOutlet属性公开。所以这里也是一张照片。抱歉,此屏幕截图不显示光标:它位于拉伸线的底端。

In real life I'm more likely to control-drag to the anonymous category in the implementation file, because I don't want an IBOutlet property to be public. So here's a picture of that too. Sorry, this screen shot does not show the cursor: it is at the bottom end of the stretch line.

这篇关于无法与IB中的约束进行插座连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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