What does selecting CALayer in View Effects Inspector inside Interface Builder do?

白昼怎懂夜的黑 提交于 2019-12-07 03:08:06

问题


Inside IB, in View Effects Inspector, there is an option to set Core Animation Layer. If I set it what does it do?

Is it equivalent to setWantsLayer:YES?

If so then as per Apple docs setWantsLayer can be called before or after setLayer:.

The order that setWantsLayer: and setLayer: are called is important, it makes the distinction between a layer-backed view and a layer-hosting view.

If I set CALayer from IB, which order would it be?


回答1:


The checkbox makes your view layer-backed (like calling setWantsLayer: without setLayer:).



来源:https://stackoverflow.com/questions/10277573/what-does-selecting-calayer-in-view-effects-inspector-inside-interface-builder-d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!