Unwanted Vertical Padding from iOS 6 on CATextLayer
问题 Background: I started my project in iOS 5 and built out a beautiful button with layer. I added a textLayer onto the button and center it using the following code: float textLayerVerticlePadding = ((self.bounds.size.height - fontSize) /2); textLayer = [[CATextLayer alloc]init]; [textLayer setFrame:CGRectOffset(self.bounds, 0, textLayerVerticlePadding)]; It works great and looks dead center until iOS 6. Problem: iOS 6 added a space (padding) between the topmost bound and the text in textLayer.