ios文字描边

- (void)drawTextInRect:(CGRect)rect {
 

            CGSize shadowOffset = self.shadowOffset; 
            UIColor *textColor = self.textColor; 
            CGContextRef c = UIGraphicsGetCurrentContext(); 
            CGContextSetLineWidth(c, 1); 
            CGContextSetLineJoin(c, kCGLineJoinRound); 
            CGContextSetTextDrawingMode(c, kCGTextStroke); 
            self.textColor = [UIColor whiteColor]; 
            [super drawTextInRect:rect];
            CGContextSetTextDrawingMode(c, kCGTextFill); 
            self.textColor = textColor; 
            self.shadowOffset = CGSizeMake(0, 0); 
            [super drawTextInRect:rect]; 
            self.shadowOffset = shadowOffset;

}

posted @ 2016-07-22 20:43  wg_workspace  阅读(338)  评论(0编辑  收藏  举报