如何在CATextLayer文本上添加边框轮廓笔划和填充笔划

时间:2015-07-17 05:12:43

标签: ios objective-c core-text quartz-core catextlayer

这是代码,

text1 =[[NSMutableAttributedString alloc]initWithAttributedString:t.string];
            NSDictionary* attributes = @{(NSString*)kCTStrokeWidthAttributeName: @(-slider.value),
                                         (NSString*)kCTStrokeColorAttributeName: (id)curruntColor ,
                                         (NSString*)kCTForegroundColorAttributeName:(id)(textView.textColor)};

            [text1 addAttributes:attributes range:NSMakeRange(0, text1.length)];
            text1=[self getScaledStringFrom:text1 withScale:1];
            t.string=text1;

滑块值是笔触的宽度,t.string表示文本图层字符串。 感谢

0 个答案:

没有答案