Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiline CATextLayer

I'm trying to recreate the multiline UILabel with a CATextlayer.

Is there a property for CATextLayer, or do I need to create it myself?

like image 700
Glenn Avatar asked Jul 22 '10 16:07

Glenn


1 Answers

I'm not sure what you mean exactly, but if you add a CATextLayer to a view, you can set it to have the same bounds as the view and if you enable the wrapped property on the CATextLayer, the text will word wrap. You can then also set the resizing mask on the layer so that changes to the view will be reflected in the layer.

like image 56
Matt Long Avatar answered Nov 14 '22 04:11

Matt Long