CATextLayer

CATextLayer *layer = [[CATextLayer alloc] init];

    layer.frame  = CGRectMake(0, 300, 100, 100);

    字体模糊

    layer.contentsScale = 10;

    字体

    layer.font = (__bridge CFTypeRef)(@"HiraKakuProN-W3");

    对其模式

    layer.alignmentMode = kCAAlignmentLeft;

    字体大小

    layer.fontSize=  30;

    自动换行

    layer.wrapped = YES;

    显示的文字

    layer.string = @" zhao zhong peng ";

    背景色

    layer.backgroundColor = [UIColor cyanColor].CGColor;

    文字的颜色

    layer.foregroundColor = [UIColor greenColor].CGColor;

[self.view.layer addSublayer:layer];

原文地址:https://www.cnblogs.com/zhaozhongpeng/p/4867832.html