Transparent layered views

I am trying to perform some simple animations using CA layers in a transparent window and corresponding view. The problem is that every time I turn on layer support (either through wishLayer in the code or with IB), the view ceases to be transparent.

I tried setting layerOfficeFloor to something with low alpha, and I took some other rather obvious approaches, but it seems to me that I missed something.

To better illustrate the issue, simply use the Round Transparent Window sample project from developer.apple.com. With a layer added (only this one line in awakeFromNib) the transparency fades http://slonce.com/layers.png

Can someone please give me some advice on this?

+3
source share
1 answer

Thanks to Dave Keck from cocoa -dev, the answer is:

[window setBackgroundColor: [NSColor clearColor]];
+1
source

Source: https://habr.com/ru/post/1722907/


All Articles