为什么我的 NSTableView 中的图像淡出?
首先,有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
来自 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."
您可能将图像视图单元格或列的“启用”属性设置为“否”(或在 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.