开发者

NSView - how can i redraw a subview without redrawing the parent view

开发者 https://www.devze.com 2023-03-16 20:44 出处:网络
I have a NSView with a sub view. I want to be able to redraw the sub view (call its drawRect) without redrawing the parent view. Is that possible?

I have a NSView with a sub view. I want to be able to redraw the sub view (call its drawRect) without redrawing the parent view. Is that possible?

When i case setNee开发者_如何学CdsDisplay on he sub view, drawRect of the parent view also called.


One thing you can do to reduce unnecessary drawing is overide -isOpaque and return YES.

Of course, you should only do this if the subview is in fact opaque.

0

精彩评论

暂无评论...
验证码 换一张
取 消