草庐IT

CTParagraphStyleRef

全部标签

objective-c - CATextLayer + NSAttributtedString + CTParagraphStyleRef

我想要一些具有自定义行距的文本,所以我使用CTParagraphStyleAttributte编写了一个属性字符串并将其传递给我的CATextLayer:UIFont*font=[UIFontsystemFontOfSize:20];CTFontRefctFont=CTFontCreateWithName((CFStringRef)font.fontName,font.pointSize,NULL);CGColorRefcgColor=[UIColorwhiteColor].CGColor;CGFloatleading=25.0;CTTextAlignmentalignment=kCT