Is it possible to add a UILabel
to a CALayer
without subclassing and drawing it in drawInContext:
?
Thanks!
See Question&Answers more detail:osIs it possible to add a UILabel
to a CALayer
without subclassing and drawing it in drawInContext:
?
Thanks!
See Question&Answers more detail:osCATextLayer *label = [[CATextLayer alloc] init];
[label setFont:@"Helvetica-Bold"];
[label setFontSize:20];
[label setFrame:validFrame];
[label setString:@"Hello"];
[label setAlignmentMode:kCAAlignmentCenter];
[label setForegroundColor:[[UIColor whiteColor] CGColor]];
[layer addSublayer:label];
[label release];