На первый взгляд мой вопрос выглядит действительно простым, но мне кажется, что я действительно не могу найти решение.Вот что это: я хочу вычислить ограничивающую рамку строки CATextLayer.Вот что я делаю:
CATextLayer *textLayer = [CATextLayer layer];
textLayer.frame = CGRectMake(80, 0.0f, 36.0f, 18.0f);
textLayer.string = @"12";
textLayer.fontSize = [UIFont systemFontSize];
textLayer.foregroundColor = [UIColor whiteColor].CGColor;
NSLog(@"(width,height)=(%f,%f)",
[textLayer.string sizeWithFont:textLayer.font].width,
[textLayer.string sizeWithFont:textLayer.font].height);
Проблема в том, что вывод всегда: (ширина, высота) = (8.000000,0.000000)