且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

NSTableView重绘不更新显示,选择粘贴

更新时间:2023-02-05 18:29:05

看起来像Core Animation和 NSTableView 不是那么好。 褪色效果是核心动画工作方式的副产品。当你在一个视图中有核心动画时,它也在所有视图的子视图中启用。

It looks like Core Animation and NSTableView aren't getting along so well. The "fading" effect is a by-product of the way core animation works. When you have core animation in one view, it is also enabled in all of that view's subviews.

我不建议在Mac上使用核心动画,除非绝对必要,因为一些界面元素(例如 NSTextView NSTableView )与它不兼容。 iOS对表视图和使用核心动画的更好的支持,主要是因为它设计了核心动画。

I don't recommend using core animation on the Mac unless absolutely necessary, because some interface elements (NSTextView and NSTableView, for example) aren't compatible with it. iOS has much better support for table views and such using core animation, mainly because it was designed with core animation in mind.

我知道一些更简单的UI元素是兼容的( NSTextField NSButton )。

I know that some more simple UI elements are compatible (NSTextField and NSButton, for example).

如果你绝对需要核心动画在窗口的其余部分,将所有其他视图在内容视图的子视图,而直接在内容视图中保留表视图。然后,您可以在其他视图中启用核心动画。

If you absolutely need core animation in the rest of the window, put all the other views in a subview of the content view, while leaving the table view directly in the content view. You can then enable Core Animation in the other view.

注释者可随意添加到列表中,并且不兼容。

Commenters, feel free to add to the list of what is and isn't compatible.