问题
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