I am trying to bring my CATextLayer
text (which is a number "1") in center of view, but what I got is very small text and not in center as shown in this image. Red circle shown is a CALayer
object itself which is animated, so I dont want to add text as sublayer to it. Instead I added as sublayer to view. The code I wrote for CATextLayer is:
CATextLayer *numbers = [CATextLayer layer];
numbers.string = @"1";
numbers.font = [UIFont fontWithName:@"Arial" size:100.0];
numbers.foregroundColor = [UIColor blackColor].CGColor;
numbers.bounds = CGRectMake(0, 0, 200, 200);
numbers.position = self.view.center;
numbers.wrapped = NO;
[self.view.layer addSublayer:numbers];
I hope my Question is clear. Please tell me where am I mistaken? Thanks alot.