可编辑的 NSTextField 自动调整大小...永远不会起作用。 OS X 中的错误?

发布于 2024-11-15 21:15:23 字数 447 浏览 3 评论 0原文

我在使用 Xcode4/OS X 10.6 的多个项目中遇到了这个问题:

image

无论我做什么,可编辑的 NSTextField (包含文本“Label”)将永远粘在父 NSView 的右边缘。

紧邻的 NSTextfield(不可编辑,文本“Sprint Goal”)始终正确调整大小 - 使用完全相同的弹簧/支柱,它粘合到父 NSView 的右边缘。

我在多个项目中遇到了相同的普遍问题 - 可编辑 NSTextField 实例的右侧边缘与浮动的左侧边缘永远不会受到尊重。不管我做什么。

漏洞?我在这里缺少一些基本的东西吗?我的所有其他小部件和控件都“按预期”工作,即使布局很复杂。即使使用简单的layotus,我也无法让 NSTextField 工作!

I've got this problem on multiple projects with Xcode4/OS X 10.6:

image

No matter what I do, the editable NSTextField (containing text "Label") will never stick to the right-edge of the parent NSView.

The immediately adjacent NSTextfield (non-editable, text "Sprint Goal") always resizes correctly - with the exact same springs/struts it glues to the right-edge of the parent NSView.

I've got the same generic problem in multiple projects - right-hand-edges of editable NSTextField instances, with floating left-edge, are never, ever honoured. No matter what I do.

Bug? Something fundamental I'm missing here? All my other widgets and controls work "as expected", even with complex layouts. I can't get NSTextField to work even with simple layotus!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱娆 2024-11-22 21:15:23

找到了!

XCode4 中可能存在错误,加上人为错误。

当您单击 NSTextField 时,它有时会一致选择该文本字段下方的项目。

在我当前项目的每种情况下,我在前字段后面都有“东西” - 通常是我根据可编辑状态来回切换的同一字段的不可编辑版本。

(所以我选择了 NSTextField - 但 Xcode4 选择了它后面的项目 - 然后我对另一个项目进行了更改。因此,文本字段保留了其默认设置 - 坚持左侧,而不是右侧)

Found it!

Possible bug in XCode4, plus human error.

When you single-click an NSTextField, it will sometimes consistently select the item BENEATH that textfield.

In each case in my current project, I had "something" behind the front field - usually a non-editable version of the same field that I was switching back/and forth to based on editable status.

(so I was selecting the NSTextField - but Xcode4 was selecting the item behind it - and then I was making changes to a different item altogether. So, the textfield was retaining its default settings - which are to stick to left, not right)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文