How to add a CALayer to an NSView on Mac OS X

前端 未结 4 367
灰色年华
灰色年华 2021-02-02 12:37

I\'m trying to learn how to use and implement CALayer in a Mac Objective-C application, but I can\'t seem to probably do the most basic thing - add a new layer and

4条回答
  •  不思量自难忘°
    2021-02-02 12:53

    Updated info (Swift): first call view.makeBackingLayer() then set wantsLayer to true.

    https://developer.apple.com/documentation/appkit/nsview/1483695-wantslayer

提交回复
热议问题