为什么我的 NSTableView 中的图像淡出?

发布于 2024-08-16 05:08:55 字数 399 浏览 4 评论 0原文

首先,有一个 NSArrayController(“服务器”),其内容是“服务器”对象的数组。

我还有一个带有列的 NSTableView 。该列绑定到服务器的“arrangedObjects.status”属性。

我使用自定义 NSValueConverter 将该状态转换为列的 dataCell 的图像,该图像是 NSImageCell

我不明白的是为什么列中显示的图像是正确的,但始终淡出。只是为了测试,我在表格视图之外有相同的图像进行比较,它画得很好。图像中的颜色不是半透明的。

NSImageCell 是否将图像绘制为褪色?我可以在 IB 中配置一些东西来让它们完全饱和吗?

To start, there's an NSArrayController ("Servers") whose content is an array of "server" objects.

I also have an NSTableView with a column. The column is bound to Server's "arrangedObjects.status" property.

I use a custom NSValueConverter to make that status into an image for the column's dataCell which is an NSImageCell.

What I don't understand is why the images that show up in the column are correct, but consistently faded out. Just to test, I have the same image outside the table view for comparison and it draws fine. The colors in the images are not semi-transparent.

Does the NSImageCell draw the images as faded? Is there something I can configure in IB that will draw them fully saturated?

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

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

发布评论

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

评论(2

2024-08-23 05:08:56

来自 Cocoa-Dev 上的 Jim Correia:

“在 10.6 上,当控件被禁用时,NSImageView 会将其内容绘制为灰色。

您的绑定已打开“有条件设置启用”。”

From Jim Correia on Cocoa-Dev:

"On 10.6, NSImageView will draw its content as dimmed when the control is disabled.

Your binding has “Conditionally Sets Enabled” turned on."

音盲 2024-08-23 05:08:56

您可能将图像视图单元格或列的“启用”属性设置为“否”(或在 IB 中取消选中)。我相信这会淡化显示的图像。

You might have the image view cell or column's "enabled" property set to NO (or unchecked in IB). I believe this fades the displayed image.

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