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