I'm again struggling with setting NSViews background colors to transparent. I have a NSCollectionView
as part of NSClipView
which is part of a NSScrollview
. My MainViewController
has an outlet to the collectionView
. With adding the two lines of code and after compiling the background is sometimes transparent but most of the times not:
view.wantsLayer = true
collectionView.layer?.backgroundColor = NSColor.clear.cgColor
I also tried to select/de-select the "Draw Background" property of the NSScrollView
in the IB without any effects.
What do I miss here.