My goal
I would like to add a vibrancy effect to a collection view.
The setup
I have the following view hierarchy:
When I use this layout, the background has the vibrancy effect as expected, but the performance is not quite there.
NSCollectionView
is optimized to work with layer-backed views, so I enable the CALayer
on the collection view's enclosing scroll view.
The problem
If I do this, the visual effect view is no longer visible, and the collection view has a white background.
My question
Is there any way to make a layer-backed view work together with NSVisualEffectView
?
So if anyone's wondering, here's the trick:
NSVisualEffectView
: correctMake sure to either set
drawsBackground
to false, or disable it in Interface Builder, and your collection view will have the vibrant background, and fast scrolling as well