uilabel文字特效製作

剛剛Q羣裏面有位美女發了她的UILabel的文字特效的效果,很受贊~我在這裏就借花獻佛了,哈……(借美女的成功記錄在我的博客裏)
 
先看看特效先吧,
 
這種特效其實也挺簡單的,就是啊
uilabel
中重寫
- (void)drawTextInRect:(CGRect)rect//方法
{
//在這個裏面寫
CGSize shadowOffset = self.shadowOffset;
         UIColor *textColor = self.textColor;
         
         CGContextRef c = UIGraphicsGetCurrentContext();
         CGContextSetLineWidth(c, 2);
         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;
 
 
    ......


}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章