Why is NSCollectionViews drawRect called first instead of subview (isOpaque:YES) bug?
Why is NSCollectionViews drawRect called first instead of subview (isOpaque:YES) bug?
- Subject: Why is NSCollectionViews drawRect called first instead of subview (isOpaque:YES) bug?
- From: Benjamin Rindt <email@hidden>
- Date: Sun, 16 Feb 2014 16:15:24 +0100
Hey guys,
I have a serious problem with the CollectionView and I don’t understand its behavior.
My Project has a Splitview into 2 Views, one is a Scrollview with a CollectionView the one is a normal NSView with background image.
The other one with the CollectionView has multiple items with own Views.
The view of the item and the other „static“ NSView with background image have a subview of MeteringView of the MatrixMixerTest example project from Apple. This Metering View is showing Audio levels passed through it in a Meter. The View has isOpaque:Yes.
The problem now is, those Meteringviews get redrawn with a timer to represent the Audio Levels but MeteringView is quite efficient to just draw the difference area what changed. In the „static“ NSView with background this works fine because isOpaque of MeteringView is preventing drawRect of the static View to draw again its background image to draw again, because if it does the meter is gone and just the currently changing parts are getting drawn.
The CollectionView works differently, there the drawRect of the Item gets somehow called first causes its background color to redraw hiding my meter. But why does it? MeteringView is added in the same way as a subview and setNeedsDisplay is called in MeteringView to redraw metering view and isOpaque to prevent the „parent“ Views to redraw.
I don’t know how to solve this, any ideas? I don’t think this is a bug but I don’t know why drawRect of the CollectionView Item is called in the first place.
Thanks - Benjamin
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden