美文网首页
字体描边

字体描边

作者: OneByte | 来源:发表于2016-12-25 18:15 被阅读44次
    • (void)drawTextInRect:(CGRect)rect {
      CGSize shadowOffset = self.shadowOffset;
      UIColor *textColor = self.zjTextBorderColor;

      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;

    相关文章

      网友评论

          本文标题:字体描边

          本文链接:https://www.haomeiwen.com/subject/udjbyttx.html