Add text to CALayer

前端 未结 7 1984
Happy的楠姐
Happy的楠姐 2020-11-29 19:28

Is it possible to add a UILabel to a CALayer without subclassing and drawing it in drawInContext:?

Thanks!

7条回答
  •  独厮守ぢ
    2020-11-29 19:51

    Add a CATextLayer as a sublayer and set the string property. That would be easiest and you can easily use a layout manager to make it very generic.

提交回复
热议问题