码迷,mamicode.com
首页 > 移动开发 > 详细

ios文字描边

时间:2016-07-22 21:13:09      阅读:273      评论:0      收藏:0      [点我收藏+]

标签:

- (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;

}

ios文字描边

标签:

原文地址:http://www.cnblogs.com/WG-WA/p/5697081.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!