UIFont *font = [UIFont boldSystemFontOfSize:20];
UIColor *color = [UIColor purpleColor];
NSDictionary *attributesDict = @{
NSFontAttributeName : font,
NSForegroundColorAttributeName: color,
NSStrokeColorAttributeName : [UIColor whiteColor], // 描边颜色
NSStrokeWidthAttributeName : @-3, // 描边宽度,记得设置为负,设置为正的话文字本身颜色不显示 };

网友评论