CATextLayer *textLayer = [CATextLayer layer];
[textLayer setFrame:CGRectMake(0, 5, kScreenWidth, 40)];
// [textLayer setPosition:POINT(CGRectGetWidth(_topView.frame) / 4, 20)];
[textLayer setString:@"下单 已支付 已发货 收货"];
[textLayer setForegroundColor:[UIColor grayColor].CGColor];
[textLayer setContentsScale:2.f];
[textLayer setWrapped:YES];
[textLayer setAlignmentMode:kCAAlignmentCenter];
[textLayer setFontSize:16.f];
[_viewForTextLayer.layer addSublayer:textLayer];
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme