简体   繁体   中英

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

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 setNeedsDisplay 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM