Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS CATextLayer wrapped doesn't work as expected

I have a CATextLayer with multiline Text. The wrapped option is set to YES. But it doesn't wrap the text on the last line. If I add another line with \n and a space, the wrapping occurs (but this destroys the layout).

This only happens in iOS >= 8.3

Any ideas what could cause this?

like image 972
Swissdude Avatar asked Sep 21 '15 22:09

Swissdude


1 Answers

Something in CATextLayer has changed in iOS 8.3 which means that you now need to add 1px more to the height than you did before. If you were using CTFramesetterSuggestFrameSizeWithConstraints then this now totals to 2px additional height.

It's an odd breakage but there's not much that can be done about that.

like image 64
Bo A Avatar answered Nov 06 '22 16:11

Bo A