iOS巅峰之label描边

- (void)drawTextInRect:(CGRect)rect

{ CGSize shadowOffset = self.shadowOffset

UIColor *textColor = self.textColor;  

CGContextRef c = UIGraphicsGetCurrentContext();  

CGContextSetLineWidth(c, self.outlineWidth); 

CGContextSetLineJoin(c, kCGLineJoinRound);  

CGContextSetTextDrawingMode(c, kCGTextStroke);  

self.textColor = self.outlineColor;  

[super drawTextInRect:rect];  

CGContextSetTextDrawingMode(c, kCGTextFill); 

self.textColor = textColor;  

self.shadowOffset = CGSizeMake(0, 0);  

[super drawTextInRect:rect];  

self.shadowOffset = shadowOffset;

}

你可能感兴趣的:(iOS,iOS,UILabel,描边,划线)