这是代码,
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表示文本图层字符串。 感谢