Resize CATextLayer to fit text on iOS
问题 All my research so far seems to indicate it is not possible to do this accurately. The only two options available to me at the outset were: a) Using a Layout manager for the CATextLayer - not available on iOS as of 4.0 b) Use sizeWithFont:constrainedToSize:lineBreakMode: and adjust the frame of the CATextLayer according to the size returned here. Option (b), being the simplest approach, should work. After all, it works perfectly with UILabels. But when I applied the same frame calculation to