我有图层和 CATextLayer。我有代码,例如:
CATextLayer *TextLayer = [CATextLayer layer];
TextLayer.bounds = CGRectMake(0.0f, 0.0f, 245.0f, 290.0f);
TextLayer.string = randomText;
CTFontCreateWithName((CFStringRef)@"HelveticaNeue-Light", 0.0, NULL);
TextLayer.backgroundColor = [UIColor blackColor].CGColor;
TextLayer.position = CGPointMake(162.0, 250.0f);
TextLayer.wrapped = YES;
TextLayer.fontSize = 20;
[self.view.layer addSublayer:TextLayer];
如何在添加 randomText 之前重新加载/刷新或清除图层?目前 textRandom 在添加文本之前加入(现有文本相互叠加),我什么也没看到。
感谢帮助!